Creating a Drop-down list for different tabs

whinks

New Member
Joined
Jul 30, 2015
Messages
4
Hello all,

I am attempting to figure out a problem and I seem to be stuck. What I am trying to do is create a drop-down list for different tabs in my worksheet. When a tab name is selected I want it to automatically direct me to that worksheet. When I am directed to a worksheet I want another drop-down list to either direct me back to the first sheet or a different sheet from there (I want the list of tab names to be different from sheet to sheet). What I have so far is below:

Code:
Private Sub Workbook_Open()

    Dim oSheet As Excel.Worksheet
    Dim oCmbBox As MSForms.ComboBox

    Set oCmbBox = ActiveWorkbook.Sheets(1).cmbSheet

    oCmbBox.Clear

    For Each oSheet In ActiveWorkbook.Sheets

        oCmbBox.AddItem oSheet.Name

    Next oSheet

End Sub

Private Sub cmbSheet_Change()

    ActiveWorkbook.Sheets(cmbSheet.Value).Activate

End Sub

This works great for my first sheet and it directs me to every sheet I want to go, but when I try to duplicate it for other sheets, it will not work. Any suggestions? I am not great at writing code so anyone who could write the code needed for this problem would be most appreciated! Thanks!
 
Last edited by a moderator:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
whinks,

Thanks for the feedback.

You are very welcome. Glad I could help.

And, come back anytime.
 
Upvote 0

Forum statistics

Threads
1,221,446
Messages
6,159,917
Members
451,603
Latest member
SWahl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top