+ Reply to Thread
Results 1 to 6 of 6

Macro for each option within a combo box activex?

  1. #1
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Question Macro for each option within a combo box activex?

    Is their any way to create a macro, individually, for each option inside of the combo box activex? I understand that you can create a macro for the combo box itself, that contains all the list option, within that combo box. I want to be able to create a macro, individually, for each option in the combo box.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Macro for each option within a combo box activex?

    Do you mean execute different macros based on selection of an item in the combo box?

    If so you can use code in the select event to determine what item was selected and then execute appropriate code.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Re: Macro for each option within a combo box activex?

    Quote Originally Posted by Andy Pope View Post
    Do you mean execute different macros based on selection of an item in the combo box?

    If so you can use code in the select event to determine what item was selected and then execute appropriate code.
    Yes, that's what i'm referring to. I've been playing around with codes in the VBA coding area, but i'm not really understanding how to connect the macro, I've created, to the specific selection? I know it's something i'm not understanding with the coding. I've tried "Select Case"... then "Case"... etc.,

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Macro for each option within a combo box activex?

    something like

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Re: Macro for each option within a combo box activex?

    Quote Originally Posted by Andy Pope View Post
    something like

    Please Login or Register  to view this content.
    Yes, that's in resemblance to what i'm trying to accomplish. For example, this is a random macro i did just to run a test.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Macro for each option within a combo box activex?

    but you are using the Listindex property, which is a value 0 to n-1 (where n is the number of items in list).
    And comparing that to text value such as "Fees" so it will never execute and of the cases.

    Change to .Value rather than .ListIndex and it will work if text matches exactly

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code works with Combo Box-Form Control, but not with Combo box - ActiveX Control
    By nangys in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2014, 08:51 AM
  2. Replies: 8
    Last Post: 12-26-2013, 02:23 PM
  3. Replies: 0
    Last Post: 10-28-2013, 04:08 AM
  4. ActiveX combo-box value depends on other combo-box value
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 09-27-2013, 05:24 PM
  5. [SOLVED] A survey with activex option button
    By stojko89 in forum Word Formatting & General
    Replies: 2
    Last Post: 09-19-2012, 05:42 AM
  6. [SOLVED] assign macro to activeX combo box
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2012, 11:19 AM
  7. ActiveX Option Buttons all act as one group
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2005, 12:06 AM

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