Highlight a selected toolbar in a menu!

A

aiyer

Hello!

I would like to highlight (possibly with a coloured 'tick mark')
selected toolbar rom a menu.
I.e. any toolbar selected by the user from a menu should be highlighte
so that the user can see which ones were selected in the end. I wrot
the following macro for the same but can't figure out what'z wrong.

==============================================

Sub Macro1()

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

End Sub
==============================================

I would appreciate your help guys.

Thanks a bunch, best regds.

Arun
 

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

Top