ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   John Walkenbach's Custom Menus (https://www.excelbanter.com/excel-programming/371047-john-walkenbachs-custom-menus.html)

Steve

John Walkenbach's Custom Menus
 
I have built a custom menu using John Walkenbach's MenuMaker routine located
at:
http://j-walk.com/ss/excel/tips/tip53.htm

What I would like is the capability to add a check mark (toggle on/off) like
is the case on the standard Excel menu for "View / Toolbars / Standard". Is
this a FaceID parameter? Any advice would be greatly appreciated.


Bob Phillips

John Walkenbach's Custom Menus
 
The property in question is the state property.

This is an example of a macro assigned to a commandbar that would do this
With Application.CommandBars.Action*Control
If .State = msoButtonUp Then
ActiveWorkbook.Worksheets(.Cap*tion).Visible = xlSheetHidden
.State = msoButtonDown
Else
ActiveWorkbook.Worksheets(.Cap*tion).Visible = xlSheetVisible
.State = msoButtonUp
End If
End With

You would need to add another column to the menu table with the initial
state, and then you have to toggle it within other code using code like that
shown above.

--
HTH


Bob Phillips

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

"Steve" wrote in message
...
I have built a custom menu using John Walkenbach's MenuMaker routine

located
at:
http://j-walk.com/ss/excel/tips/tip53.htm

What I would like is the capability to add a check mark (toggle on/off)

like
is the case on the standard Excel menu for "View / Toolbars / Standard".

Is
this a FaceID parameter? Any advice would be greatly appreciated.




Steve

John Walkenbach's Custom Menus
 
Thanks Bob. Worked Great!!

"Bob Phillips" wrote:

The property in question is the state property.

This is an example of a macro assigned to a commandbar that would do this
With Application.CommandBars.ActionÂ*Control
If .State = msoButtonUp Then
ActiveWorkbook.Worksheets(.CapÂ*tion).Visible = xlSheetHidden
.State = msoButtonDown
Else
ActiveWorkbook.Worksheets(.CapÂ*tion).Visible = xlSheetVisible
.State = msoButtonUp
End If
End With

You would need to add another column to the menu table with the initial
state, and then you have to toggle it within other code using code like that
shown above.

--
HTH


Bob Phillips

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

"Steve" wrote in message
...
I have built a custom menu using John Walkenbach's MenuMaker routine

located
at:
http://j-walk.com/ss/excel/tips/tip53.htm

What I would like is the capability to add a check mark (toggle on/off)

like
is the case on the standard Excel menu for "View / Toolbars / Standard".

Is
this a FaceID parameter? Any advice would be greatly appreciated.






All times are GMT +1. The time now is 02:36 AM.

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