+ Reply to Thread
Results 1 to 6 of 6

Run macros based on List Box selection

  1. #1
    Registered User
    Join Date
    01-04-2016
    Location
    Hamburg, Germany
    MS-Off Ver
    Office (Mac) 2011
    Posts
    1

    Exclamation Run macros based on List Box selection

    Hi,

    Unfortunately, this is rather urgent.

    I have created a List Box with a bunch of values.
    Each value should be assigned a Macro (those copy&paste data from A to B, find&replace on the fly and already exist&work).
    The user should be able to select one, some or all (or none) of the values, hit a "run" button, to execute the Macros assigned to the selected values.

    Basically, I need this in code format:

    If "A" is selected, run macro "A".
    If "B" is selected, run Macro "B".
    ...
    ...

    I have exhausted any combination of possible search terms on Google and not found a working answer, would be great if anyone could help.
    I know I need to use some variation of call or run, but I can't for the life of me figure out how to get the values from the list box to act upon them.

    In case you have not figured it out yet, I really have no clue what I'm doing :-D

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Run macros based on List Box selection

    You can create code to run based on a particular cell being changed.

    If you set that code to point to where your list box is run, you can run macros based on conditional values of the cell.

    I believe what you want to do is to check out the "Event Procedures" Tutorial that WiseOwl has put together: https://www.youtube.com/playlist?lis...3akx_gFMnpxTN5

  3. #3
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Run macros based on List Box selection

    See about 16:55 min. into video: https://www.youtube.com/watch?v=0EXd...3akx_gFMnpxTN5

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Run macros based on List Box selection

    What do you see when you step through the macro step-by-step?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  5. #5
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Run macros based on List Box selection

    Apologies: I am unsure about how to delete this post. I was having issues copying and pasting VBA code to the forum. My Code was interpreted as HTML (when copying and pasting from Notepad), which is not allowed.
    Last edited by joe31623; 01-04-2016 at 10:30 AM.

  6. #6
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Run macros based on List Box selection

    Under the worksheet that includes the dropdown list, you'll want the "Selection Change" dropdown tab on the right and Worksheet dropdown tab on the left.

    Please Login or Register  to view this content.
    Hope this helps. Good luck!
    Last edited by joe31623; 01-04-2016 at 10:24 AM.

+ 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. Filters Based on Selection (Macros)
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2015, 04:23 AM
  2. Auto-Generate List from reference cells based on data validation list selection
    By BoundCustomDesign in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2014, 11:06 AM
  3. Replies: 0
    Last Post: 12-28-2012, 06:24 PM
  4. WorkSheet List Box Multiple Selection by Macros
    By karan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2012, 01:35 AM
  5. [SOLVED] Running macros by making a selection in a dropdown list
    By blueshift1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2012, 02:22 PM
  6. Replies: 8
    Last Post: 07-02-2009, 07:13 PM
  7. List Box selection based on combo box selection
    By MFA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2008, 10:19 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