ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tools/Customize question - toggle Show/Hide Comments without a macro (https://www.excelbanter.com/excel-programming/404673-tools-customize-question-toggle-show-hide-comments-without-macro.html)

[email protected]

Tools/Customize question - toggle Show/Hide Comments without a macro
 
This might be the wrong forum for this post, but if anyone knows the
answer to this, I think it will be someone in this group.

In Excel 2003 I can drag-create a button from Tools/Customize/Commands/
View/Comments

I find this button quite useful for toggling the display of comments.
However, it also makes the "Reviewing" toolbar visible when comments
are made visible, and then doesn't hide it when comments are turned
off.

Is there a way prevent the Reviewing toolbar from appearing at all, or
to hide it when comments are turned off?

The following "one-liner" is an ok workaround, but it would be really
nice to be able to do this without a macro.

Sub ShowHideComments()
Application.DisplayCommentIndicator = -1 *
Application.DisplayCommentIndicator
End Sub

Thanks,

Brian Murphy
Austin, Texas

Jim Cone

Tools/Customize question - toggle Show/Hide Comments without a macro
 
Brian,

Use the comments button you created and assign the following code to it...
(Tools | Customize and right-click the button)
'--
Sub UnderControl()
If Application.DisplayCommentIndicator < 1 Then
Application.CommandBars("Reviewing").Visible = False
Application.DisplayCommentIndicator = 1
Else
Application.DisplayCommentIndicator = -1
End If
End Sub

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
This might be the wrong forum for this post, but if anyone knows the
answer to this, I think it will be someone in this group.

In Excel 2003 I can drag-create a button from Tools/Customize/Commands/
View/Comments
I find this button quite useful for toggling the display of comments.
However, it also makes the "Reviewing" toolbar visible when comments
are made visible, and then doesn't hide it when comments are turned off.
Is there a way prevent the Reviewing toolbar from appearing at all, or
to hide it when comments are turned off?

The following "one-liner" is an ok workaround, but it would be really
nice to be able to do this without a macro.

Sub ShowHideComments()
Application.DisplayCommentIndicator = -1 *
Application.DisplayCommentIndicator
End Sub

Thanks,
Brian Murphy
Austin, Texas

[email protected]

Tools/Customize question - toggle Show/Hide Comments without amacro
 
Thanks for the reply, Jim.

I actually was already using my "one-liner" macro. What I was looking
for was a "non-macro" way to do the same thing.

I think your reply confirms that a macro is the only way.

Cheers,

Brian



All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com