Customise Button on toolbar

G

Guest

I am trying to get a menu button to change its text based on an action

I have a series of commands to either hide or show toolbars


'Group1
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Control Toolbox").Visible = True
Application.CommandBars("Hyperion Essbase").Visible = True
Application.CommandBars("Walmac").Visible = False
CommandBars("Worksheet Menu Bar").Enabled = True
Application.DisplayFormulaBar = True


'

'Group2
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Hyperion Essbase").Visible = False
CommandBars("Worksheet Menu Bar").Enabled = False
Application.DisplayFormulaBar = False
Application.CommandBars("Walmac").Visible = True

when the action in group1 are done I want the button text to say
HideToolbars, then when I select the button it will do the actions in group2
and the text should change to Show Toolbars and so on

any suggestions

thanks
 
B

Bob Phillips

In the Hide macro , add this code

With Application.CommandBars.ActionControl
.Caption = "Show Toolbars"
End With


and in the show,

With Application.CommandBars.ActionControl
.Caption = "Hide Toolbars"
End With




--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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

Similar Threads


Top