Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have created a menu bar using the following VBA (relevant portion anyway): ' Add a new menu EMPLOYEES Set NewMenu = NewMenuBar.Controls.Add _ (Type:=msoControlPopup) NewMenu.Caption = "&Employees" ' Add a new menu item SHOW INFO Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton) With NewItem ..Caption = "&Show Info" ..OnAction = "OpenStaffInfo" End With ' Add a new menu item HIDE INFO Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton) With NewItem ..Caption = "&Hide Info" ..OnAction = "HideStaffinfo" End With ---I have tried everything syntax-wise to disable each menu item if the other one is selected, putting the code in each sub: Sub OpenStaffInfo() Columns("A:C").Select Selection.EntireColumn.Hidden = False ‘ Disable this menu option code here (nothing seems to work!) ‘ Enable Hide Staff Info menu option here (nothing seems to work!) End Sub Sub HideStaffInfo() Columns("A:C").Select Selection.EntireColumn.Hidden = True ‘ Disable this menu option code here (nothing seems to work!) ‘ Enable Open Staff Info menu option here (nothing seems to work!) End Sub VBA help and all my books still lead me to syntax errors...I am still a bit of a novice no formal training Help would be very appreciated...I am so close this drives me crazy! -Dave -- Applewine ------------------------------------------------------------------------ Applewine's Profile: http://www.excelforum.com/member.php...fo&userid=5512 View this thread: http://www.excelforum.com/showthread...hreadid=378671 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
enabling/disabling a set of code from within a spreadsheet sheet | Excel Discussion (Misc queries) | |||
Enabling sub menu items via vba | Excel Worksheet Functions | |||
Disabling/Enabling Macros | Excel Programming | |||
Disabling menu items in VBE | Excel Programming | |||
Enabling/Disabling Macros | Excel Programming |