Thread: Menu Item name
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Menu Item name



you'll want the "Workbook Tabs" popup..

Normally you'd rightclick the arrows in the bottomleft
part of a window.. but you can add it to the menu bar
like:


Sub CreateMenu_Navigator()
Const MYTAG = "WBT"
With CommandBars
While Not .FindControl(Tag:=MYTAG) Is Nothing
.FindControl(Tag:=MYTAG).Delete
Wend
End With
With CommandBars("Worksheet Menu Bar")
With .Controls.Add(msoControlPopup, temporary:=True)
.Tag = MYTAG
.Caption = "Navigator"
.OnAction = "showWBT"
End With
End With

End Sub

Sub showWBT()
CommandBars("Workbook Tabs").ShowPopup
End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Christopher Sequeira wrote :

I need a code to add a custom menu to worksheet menu bar and populate
it with the sheet name in the workbook. Further, if one clicks the
particular sheet name, only that particular sheet should be visible.
I tried populating the menu with sheet name in the workbook, however,
I am unable to do the later.
Any suggestions..