+ Reply to Thread
Results 1 to 8 of 8

Run Macros from Multiple Drop down lists in same sheet

  1. #1
    Registered User
    Join Date
    09-10-2007
    Posts
    40

    Run Macros from Multiple Drop down lists in same sheet

    Hi there,

    I would like to be able to run different Macros from about 4 different drop down lists in one single sheet. I am using the following code to run from a single drop down list.
    Please Login or Register  to view this content.
    How can I run more macros from other drop down lists located in other cells in the same sheet.

    Any help on this issue would be greatly appreciated,

    Regards,

    James.
    Last edited by VBA Noob; 10-04-2007 at 07:40 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi James,

    You can hopefully try a Select Case routine, such as the example provided below:
    Please Login or Register  to view this content.
    Change the cells to your cell references and replace the MsgBox's with your code. You can have as many Case statements as you need, and you should typically use a Case Else as your last statement just in case the rest don't return a result.

  3. #3
    Registered User
    Join Date
    09-10-2007
    Posts
    40
    Thanks for the reply. There was no such luck with that solution.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    "No such luck.." doesn't give any of us a clue as to WHY my suggestion didn't work. Please either give more details or post a copy of your spreadsheet (must be zipped first) and let us know exactly what you're attempting to do.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi Thanks for your help so far, it is much appreciated.

    I am working with an array of data that can be filtered by many columns and criteria. What I need to do is be able to select from a drop down list and run and macro based on a selection.

    I can do this fine if I only run one drop down list per page. The problem I am having is working out how to use 2 or more drop down lists and select an option from it and run a macro to filter the results.

    At present I am using this code

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$7" Then
    If Target = "30" Then
    T_30

    but as you can see this only refers to A7. What I need is the ability to have other cells which contain drop down lists to be part and have the ability to activate a macro.

    I did try your code, and your instructions and it doesn't attempt to execute the macro.

    If you have any ideas of, I would be fond to hear of them.

    Many Thanks,

    James
    Seeing as it's now 11:30pm and I have to get some sleep before meetings in the morning, perhaps someone in another time zone can assist you with this for now. Thanks for providing more information.

  6. #6
    Registered User
    Join Date
    09-10-2007
    Posts
    40
    Does anyone have any ideas on this. I will give $30USD to whoever finds me a working solution. .Cheers..

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Firstly please read forum rules below and reply confirming you have read them otherwise post will be deleted.

    I wrapped your code in post 1 and will move to programming as per rules.

    Now can you explain why pjoaquin didn't work as he requested in post 4.


    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  8. #8
    Registered User
    Join Date
    09-10-2007
    Posts
    40
    Hi,

    Thank you, I have now read the forum rules.

    Im not sure why the code in post 4 didn't work. I inserted it into VB as explained and when I tried to select a drop down box, nothing happened at all. It was referring to the correct cell and the correct macro.

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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