|  

» Change the availability for the shortcut menus using VBA in Microsoft Excel

VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
The macro below shows how you can toggle the availability state for the shortcut menus.
Sub ToggleCommandBars()
Dim cbEnabled As Boolean
    cbEnabled = Not CommandBars(25).Enabled
    CommandBars(25).Enabled = cbEnabled ' shortcutmenu for cells
    CommandBars(26).Enabled = cbEnabled ' shortcutmenu for columns
    CommandBars(27).Enabled = cbEnabled ' shortcutmenu for rows
    CommandBars("Toolbar List").Enabled = cbEnabled ' shortcutmenu for toolbars
End Sub


Rate This Tip
12 34 5
Rating: 2.80     Views: 10773
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments