LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Using drop down menu to "go to" tab

If you right-click on the navigation arrows next to the sheet tabs, it
display a list of sheets.

Another way is to add a commandbar dropdown like this


In the ThisWorkbook code module, add this code

Dim AppClass As New clsAppEvents

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Call removeCommandBars

End Sub

Private Sub Workbook_Open()
Dim sh As Object

With Application.CommandBars("Formatting")
With .Controls.Add(Type:=msoControlDropdown, temporary:=True)
.BeginGroup = True
.Caption = "SheetList"
.OnAction = "SheetGoto"
For Each sh In ActiveWorkbook.Sheets
.AddItem sh.Name
Next sh
End With
End With

Set AppClass.App = Application

End Sub

Then, add a class module and call it clsAppEvents, and add this code

Private Sub App_WorkbookActivate(ByVal Wb As Workbook)
Dim sh As Object
With Application.CommandBars("Custom Toolbar").Controls("Goto Sheet")
.Clear
For Each sh In Wb.Sheets
.AddItem sh.Name
Next sh
.ListIndex = 1
End With
End Sub

And finally, in a standard code module, add

Private Sub SheetGoto()
With Application.CommandBars.ActionControl
ActiveWorkbook.Sheets(.Text).Select
End With
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"keeper" wrote in message
...
Is there a way to use a drop down menu to select the tab and then go to

it?
I'm trying to make this worksheet as user friendly as possible and there

are
too many tabs to search through and being able to select it from a drop

down
menu would be easier.
Possible?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Menu will not automatically drop down anymore Irene Pai Excel Discussion (Misc queries) 5 May 12th 11 07:43 AM
hyperlinks in drop down menu MikeyB Excel Worksheet Functions 0 November 22nd 05 03:49 PM
hyperlinks in drop down menu MikeyB Excel Worksheet Functions 0 November 22nd 05 03:48 PM
Help with drop down menu Jrr6415sun Excel Worksheet Functions 4 July 10th 05 05:58 PM
How do I set up a drop down menu within a drop down menu? Rob Excel Discussion (Misc queries) 1 April 12th 05 06:02 PM


All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"