Results 1 to 5 of 5

Combo Box (Form Control) With Macro On A Graph Sheet

Threaded View

  1. #3
    Registered User
    Join Date
    05-09-2012
    Location
    USA
    MS-Off Ver
    2019 16.0.13205.200000 64-bit
    Posts
    61

    Re: Combo Box (Form Control) With Macro On A Graph Sheet

    Quote Originally Posted by Andy Pope View Post
    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?
    Last edited by splendidus; 05-31-2012 at 09:21 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1