
Originally Posted by
Andy Pope
Has to be a Form control, ActiveX controls are not supported, on chart sheets.
Assign a macro to the combo box and within it determnine the action to take based on the value.
This is for an combo with 3 list items.
Sub DropDown1_Change()
Dim shpTemp As Shape
Set shpTemp = ActiveSheet.Shapes(Application.Caller)
Select Case shpTemp.ControlFormat.Value
Case 1
MsgBox "You chose " & shpTemp.ControlFormat.List(1)
Case 2
MsgBox "You chose " & shpTemp.ControlFormat.List(3)
Case 3
MsgBox "You chose " & shpTemp.ControlFormat.List(2)
End Select
End Sub
Thank you so much for both your kind reply and the example attached! : )))
My question, however, is: can I make another macro stored in the same workbook run when selecting each point. So, I create a Combo Box (Form Control), attach the macro you suggested to it, BUT selecting each item should run a separate macro: e.g. selecting entry 1 would run/launch macro 1, selecting entry 2 would launch macro two, etc. Those macros are done already (stored in a module like any other normal macro) and I simply need a way to run/call/execute each of them when an entry is selected. So something that would look like:
Case 1
Call MyMacroOne
Case 2
Call MyMacroTwo
I know I can run a macro using a Button (Form Control) object, but there are 30+ items, so putting 30+ buttons on the graph is too much. So I'm looking to do the same (as with buttons) thing using a Combo Box.
Any chance this could be done?
Bookmarks