+ Reply to Thread
Results 1 to 5 of 5

link macros to more than one data validation drop list

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    2

    link macros to more than one data validation drop list

    I have a query regarding data validation drop down list:
    - there are two data validation drop down lists and each of these lists are on seperate sheets in the same workbook.
    - there are macros assigned to each specific drop down list.

    Example:
    In a sheet named "Total"
    there is a drop down list containing five selections:
    e.g Belguim,France,Ireland,Italy and Spain
    and each selection is linked to a macro(s).The target address of the drop down list is "D2".If France is selected from the drop down list its' specific macro automatically runs.
    In a sheet named "All Service lines"
    there is a drop down list containing five selections:
    e.g Tax,Advisory,Insurance,Human Capital,Restructuring
    and each selection is linked to a macro(s).The target address is"D2".If Tax is selected then its' specific macro will run.

    The code I used so far is:

    Please Login or Register  to view this content.
    Regards
    William Robertson
    Last edited by VBA Noob; 05-02-2009 at 12:18 PM. Reason: Added code tags as per forum rules

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,925

    Re: link macros to more than one data validation drop list

    Your question is....??

    I think you need the CHANGE event vs. the SELECTIONCHANGE.

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    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

    Re: link macros to more than one data validation drop list

    Try this in ThisWorkbook module.

    Need to change the macro names to the country e.f

    instead of Macro1 use France etc

    Please Login or Register  to view this content.
    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 !!!

  4. #4
    Registered User
    Join Date
    04-30-2009
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: link macros to more than one data validation drop list

    Thanks very much for your help
    I did try your code Vba Noob and protonLeah in the worksheet attached named "Example".
    What am I doing wrong?

    Regards
    William
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: link macros to more than one data validation drop list

    This routine needs to go in the ThisWorkbook module:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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