Results 1 to 5 of 5

link macros to more than one data validation drop list

Threaded View

  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:

    Private Sub Worsheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$D$2" Then
    If Target = "Belguim" Then
    macro 1
    ElseIf Target = "France" Then
    macro2
    
    and so on
    
    
    EndIf
    EndSub
    Regards
    William Robertson
    Last edited by VBA Noob; 05-02-2009 at 12:18 PM. Reason: Added code tags as per forum rules

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