Hi!
I haven't been able to find an answer on this and my issue could be piecing together code I found on multiple forums. This worked fine with the first combo box I tried but I am unable to get this to work on subsequent worksheets. My goal is to have an ActiveX ComboBox drop down worksheets navigator on each tab in the workbook.
In Lists!E:E I have the list of the actual worksheet names they can access dynamically populating based upon formulas and user selections. The number of items will shrink and grow to a currently unknown amount. (I did set the code for E2:E200 for my initial testing) This list is what I want to show as drop down selections.
The first/main worksheet is called Program_Variables with ComboBox21 and CommandButton21. After a worksheet name is selected in the drop down, they click the button to navigate to that worksheet. This functionality is what I would like to duplicate across all worksheets.
In case it is helpful the next tab I tried to place this on is called Summary-Program_Totals.
Here is the code that I was using, it worked successfully for the ComboBox on the Program_Variables tab but I can't seem to get this to duplicate or work when placed on the Summary-Program_Totals tab. I wasn't sure how to modify this properly.
VBA Code for the Program_Variables worksheet (ComboBox tab)
VBA Code for the Lists worksheet
I haven't been able to find an answer on this and my issue could be piecing together code I found on multiple forums. This worked fine with the first combo box I tried but I am unable to get this to work on subsequent worksheets. My goal is to have an ActiveX ComboBox drop down worksheets navigator on each tab in the workbook.
In Lists!E:E I have the list of the actual worksheet names they can access dynamically populating based upon formulas and user selections. The number of items will shrink and grow to a currently unknown amount. (I did set the code for E2:E200 for my initial testing) This list is what I want to show as drop down selections.
The first/main worksheet is called Program_Variables with ComboBox21 and CommandButton21. After a worksheet name is selected in the drop down, they click the button to navigate to that worksheet. This functionality is what I would like to duplicate across all worksheets.
In case it is helpful the next tab I tried to place this on is called Summary-Program_Totals.
Here is the code that I was using, it worked successfully for the ComboBox on the Program_Variables tab but I can't seem to get this to duplicate or work when placed on the Summary-Program_Totals tab. I wasn't sure how to modify this properly.
VBA Code for the Program_Variables worksheet (ComboBox tab)
Code:
'******************************
'****WORKSHEET SELECTOR CODE****
'******************************
Private Sub ComboBox21_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If ComboBox21.Value = vbNullString Then Exit Sub
If (KeyCode <> 13) Then Exit Sub
Sheets(ComboBox21.Value).Select
End Sub
'************************************
'****WORKSHEET NAVIGATE BUTTON CODE****
'************************************
Private Sub CommandButton21_Click()
If ComboBox21.Value = vbNullString Then Exit Sub
Sheets(ComboBox21.Value).Select
End Sub
VBA Code for the Lists worksheet
Code:
Private Sub Worksheet_Calculate()
Dim cell As Range
With Worksheets("Program_Variables").OLEObjects("ComboBox21").Object
.Clear
For Each cell In Range("E2:E200").SpecialCells(3)
If Len(cell.Value) > 0 Then .AddItem cell
Next
End With
End Sub