» Change the availability for a menu item using VBA in Microsoft Excel
VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
CATEGORY - Menus, Toolbars, Status bar in VBA
VERSION - All Microsoft Excel Versions
Sub ToggleMenuControls()
Dim m As CommandBarControl, mi As CommandBarControl
Set m = CommandBars.FindControl(ID:=30002) ' File Menu
If m Is Nothing Then Exit Sub
For Each mi In m.Controls
If mi.ID = 18 Then mi.Enabled = Not mi.Enabled
' toggles the state for the Print menu
Next mi
Set mi = Nothing
Set m = Nothing
End Sub
Book Store:
Recommended Books:
- The 22 Immutable Laws of Marketing : Exposed and Explained by the World's Two
- The McGraw-Hill 36-Hour Course in Finance for Nonfinancial Managers
- Preparing the Marketing Plan (Ama Marketing Toolbox Series New Edition)
- Dictionary of Finance and Investment Terms
- Microsoft PowerPoint Version 2002 Step by Step
- Understanding Financial Statements
No comments have been submitted.

