Did you put this combobox or Dropdown on a worksheet?
If yes, did you use a combobox from the Control toolbox toolbar?
If yes, you could use this code:
Option Explicit
Sub ddSelectSheets()
Dim myDD As DropDown
Set myDD = ActiveSheet.DropDowns(Application.Caller)
With myDD
On Error Resume Next
Worksheets(.List(.ListIndex)).Select
If Err.Number <> 0 Then
Beep
Err.Clear
End If
On Error GoTo 0
End With
End Sub
==
Just double click on the combobox and while you're in design mode and you'll be
taken to the location to paste this code.
======
If you used a dropdown from the Forms toolbar, you could assign the dropdown
this macro:
Option Explicit
Sub ddSelectSheets()
Dim myDD As DropDown
Set myDD = ActiveSheet.DropDowns(Application.Caller)
With myDD
On Error Resume Next
Worksheets(.List(.ListIndex)).Select
If Err.Number <> 0 Then
Beep
Err.Clear
End If
On Error GoTo 0
End With
End Sub
This kind of code goes into a General module.
hit alt-f11 to see the VBE.
select your workbook/project
rightclick on it and choose Insert|module
paste that second code in that code window.
Back to excel. Right click on the dropdown and select assign macro. Choose
ddSelectsheets and try it out.
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Another alternative:
How about a floating toolbar that displays all the worksheet names?
http://groups.google.com/[email protected]
You can use it for any open workbook.