Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Customise Button on toolbar

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Customise Button on toolbar

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I customise quick access toolbar button images in Excel 200 Andie Excel Discussion (Misc queries) 1 August 25th 07 12:08 PM
Customise the summation function / button Mr. Low Excel Worksheet Functions 0 June 12th 06 04:11 PM
how can I customise a toolbar with a tag that holds macros Drewb Charts and Charting in Excel 0 June 5th 06 04:30 PM
customise button(macro) on toolbar / workbook protection tango Excel Programming 1 October 21st 04 10:49 AM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"