Results 1 to 4 of 4

Thread: " Drop Down Lists in one worksheet - adding separate macros to each
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Sep 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default " Drop Down Lists in one worksheet - adding separate macros to each

    Hi there, I know very little about VBA, only starting using it this week by copying from Google, so my understanding of it is very small.

    I've been searching the net for a solution to my problem, however given my lack of understanding of VBA, have not been able to decipher solutions on Google

    I have created a form in Excel, which contains a number of drop down lists. I have also saved a number of macros which I would like to activate upon specific drop down selections being made. I have been able to get a set of 2 macros to work on one drop down by using the following code:


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("c60")) Is Nothing Then
    Select Case Range("c60")
    Case "Abseil_Plan": Abseil_Plan
    Case "Climbing_Plan": Climbing_Plan
    End Select
    End If
    End Sub


    I have read however that you can only use one instance of Private Sub Worksheet_Change(ByVal Target As Range) per worksheet.
    Is this true?
    If it is possible, how do I add a separate set of macros to a different drop down list within the same worksheet? I just want to keep it simple

    Thanks, appreciate any help you may have

    Jackie

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,170
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: " Drop Down Lists in one worksheet - adding separate macros to each

    Hi & welcome to MrExcel.
    You can do it like
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("c60")) Is Nothing Then
       Select Case Range("c60")
          Case "Abseil_Plan": Abseil_Plan
          Case "Climbing_Plan": Climbing_Plan
       End Select
    ElseIf Not Intersect(trget, Range("D6")) Is Nothing Then
       'do something
    End If
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Sep 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: " Drop Down Lists in one worksheet - adding separate macros to each

    Wow - thats great, it worked, thanks sooo much for your help

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,170
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: " Drop Down Lists in one worksheet - adding separate macros to each

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •