MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Hiding Specific Items in a Menu Bar

Posted by Stan on September 28, 2001 7:05 AM

I am using the following to hide the Menu Bar

Application.CommandBars("Worksheet Menu Bar").Enabled = False.

How can I, for example, hide everything but the File and Edit commands?



Posted by Juan Pablo on September 28, 2001 7:11 AM

Use this:

Sub hide()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Worksheet Menu Bar").Controls
If ctl.Index >= 3 Then ctl.Visible = False
Next ctl
End Sub

Juan Pablo