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

B

bmurphy

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
 
J

Jim Cone

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)




<[email protected]>
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
 
B

bmurphy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top