ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Placing checkmark beside menu item (https://www.excelbanter.com/excel-programming/305143-placing-checkmark-beside-menu-item.html)

DonB[_2_]

Placing checkmark beside menu item
 
Can anyone tell me how to programatically place a
checkmark beside a menu item? For example, under the View
menu, a checkmark appears beside Formula Bar and Status
Bar if they are visible.

It seems to me I once saw an example of how to do this,
but it's been lost in the mists of time.

Thanks

Bob Phillips[_7_]

Placing checkmark beside menu item
 
Don,

This is an example of code that sets/unsets a checkmark when a m enu is
clicked, It goes in the macro assigned to the menu item in OnAction.

With Application.CommandBars.ActionControl
If .State = msoButtonUp Then
ActiveWorkbook.Worksheets(.Caption).Visible = xlSheetHidden
.State = msoButtonDown
Else
ActiveWorkbook.Worksheets(.Caption).Visible = xlSheetVisible
.State = msoButtonUp
End If
End With


--
HTH

-------

Bob Phillips
"DonB" wrote in message
...
Can anyone tell me how to programatically place a
checkmark beside a menu item? For example, under the View
menu, a checkmark appears beside Formula Bar and Status
Bar if they are visible.

It seems to me I once saw an example of how to do this,
but it's been lost in the mists of time.

Thanks





All times are GMT +1. The time now is 07:51 PM.

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