PC Review


Reply
Thread Tools Rate Thread

Customise Button on toolbar

 
 
=?Utf-8?B?TmlnZWw=?=
Guest
Posts: n/a
 
      10th Jan 2007
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
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      10th Jan 2007
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)

"Nigel" <(E-Mail Removed)> wrote in message
news:F7E60588-07B6-4BD6-B500-(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I customise quick access toolbar button images in Excel 200 =?Utf-8?B?QW5kaWU=?= Microsoft Excel Misc 1 25th Aug 2007 12:08 PM
WLM - Anyway to customise the toolbar? Mac Windows Vista Mail 4 6th Jun 2007 05:23 PM
How to customise language on toolbar =?Utf-8?B?bmV3Y29tZXIxMDAx?= Microsoft Word Document Management 1 21st Sep 2005 11:51 PM
customise button(macro) on toolbar / workbook protection tango Microsoft Excel Programming 1 21st Oct 2004 10:49 AM
customise toolbar for a particular spreadsheet only Microsoft Excel Misc 1 1st Sep 2004 08:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:09 AM.