+ Reply to Thread
Results 1 to 4 of 4

Running pre recorded macros from selections made in list box

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    Usk, wales
    MS-Off Ver
    2010
    Posts
    26

    Running pre recorded macros from selections made in list box

    Hello all,

    i am new to this forum and relatively green when it comes to VBA so please bear with me.

    I have recorded about thirty macros which essentially filter, group and display rows on a spreadsheet.
    I could create a button for each one and put it on a home/switchboard page but was hoping I could create a form/list box link to the data and run the appropriate macro.
    I've created a list which appears in the form/listbox and can activate on the spreadsheet. Just can't work out how to run the macro corresponding to the selected item in the list box.

    any help would be much appreciated.

    Ta,

    john

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Running pre recorded macros from selections made in list box

    Hi John,

    First, putting your list in a Userform is a lot harder than doing the list using a Cell Validation.

    If you have the list in a Cell with Validation then you can use Event Code (behind the worksheet) to Call your other subroutines based on what is in the dropdown cell when you leave the cell.

    You really need to supply a workbook with a sample of your userform and a few of the Subroutines you want to branch to, to get a better answer.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    01-30-2015
    Location
    Usk, wales
    MS-Off Ver
    2010
    Posts
    26

    Re: Running pre recorded macros from selections made in list box

    Thanks Marvin,

    I can't really post a sample of the workbook as it contains sensitive info.
    I might be able to to concoct a sanitised version of it though.
    I'll give the validation option a try in the meantime.

    Thanks again,

    John

  4. #4
    Registered User
    Join Date
    01-30-2015
    Location
    Usk, wales
    MS-Off Ver
    2010
    Posts
    26

    Re: Running pre recorded macros from selections made in list box

    Still stumped. i can't seem to work out how to trigger the macro. The nearest I'v got is with a drop down list but as soon as I touched the sheet it shot straight to the first macro not allowing me to choose.

    I've attached a mocked up workbook with a list box and drop down list on the home page. The macros have been pre recorded to deliver Red, amber, green, yellow or blue rows according to what is selected from the home page.

    I just need help with the code to get them to fire when R, A, Y, g or B are selected from the list box/drop down list.

    Thanks for looking.

    Johntest.xlsm

+ 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. Replies: 3
    Last Post: 12-15-2013, 11:14 AM
  2. [SOLVED] List of last running macros
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-24-2013, 02:09 PM
  3. [SOLVED] If two different selections made from drop down menu = to answer in new cell
    By randomfluky in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2013, 05:54 AM
  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. Userform ListBox that recalls prior selections made
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2010, 02:54 PM

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