+ Reply to Thread
Results 1 to 3 of 3

Run different macros based on userform checkbox values

  1. #1
    Registered User
    Join Date
    03-16-2013
    Location
    DK
    MS-Off Ver
    Excel 2010
    Posts
    16

    Run different macros based on userform checkbox values

    Hi all

    Have been looking around to see if I could find the solution to my problem myself, but I have come up short..

    Basically I am creating a userform containing 6 different checkboxes, 2 optionbuttons & 1 commandbutton.
    I have 12 different macros (2 sets each with 6 macros), which must run depending on the selections made.

    In short:
    Any combo of the 6 checkboxes is possible

    The option button decides whether to run a combo of the 6 macros in set 1 (based on user selection in the 6 checkboxes), or a combo of the 6 macros in set 2 (Still based on the user selection in the 6 checkboxes)

    The command button executes the choices made..

    If for example the user chooses checkbox 2, 4 & 6

    If option button 1 is chosen - Then when U click RUN, macro no# 2, 4 & 6 must be run/called..
    If option button 2 is chosen - Then when U click RUN, macro no# 8, 10 & 12 must be run/called..

    Example picture of userform attached..

    If anyone has a solution to the above please let me know.

    Regards
    Henrik
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Run different macros based on userform checkbox values

    The direct answer is to set up a bunch of If Statements. Something like this:

    Please Login or Register  to view this content.
    This is by no means the best way, but given the limited information, it is a solution.

  3. #3
    Registered User
    Join Date
    03-16-2013
    Location
    DK
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Run different macros based on userform checkbox values

    Hi again

    Solved the issue I had..
    The problem was quite small but yet for me very easy to miss..
    I use an english version of Excel at work, and a danish version at home..

    In english it's spelled "MACRO" but in danish it's spelled "MAKRO"

    So with minor adjustments, using checkboxes and not comboboxes, below code works perfect for me..

    Please Login or Register  to view this content.

+ 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. Hide rows based on userform checkbox
    By rodrignj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-21-2015, 05:38 AM
  2. Saving and changing values based on a checkbox
    By kaligad in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-19-2012, 08:04 AM
  3. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  4. Run different Macros based on what selections have been made in checkbox
    By vetteengr in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-13-2012, 01:13 PM
  5. Dynamic Userform (resizing based on checkbox selection)
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2011, 04:50 PM

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