+ Reply to Thread
Results 1 to 8 of 8

Dropdown List value triggers macro.

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Dropdown List value triggers macro.

    I have a dropdown list at c19 with 4 options. I'm attempting to trigger a msgbox to prompt the user for a secondary piece of data if option 2 is selected.

    the following code snippit is what I'm attempting to modify to meet my needs but it doesn't seem to be working:

    Please Login or Register  to view this content.
    Any assistance would be appreciated. When I pick an item from the list I get a compile error sub or function not defined.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Dropdown List value triggers macro.

    The obvious question then is do the macros MarcoA, MacroC, MarcoD and Get_WO_NUM exist?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dropdown List value triggers macro.

    It works for me.
    As it says "Sub Or function not Defined" it would point to one of those Subs (Call ---) not existing , Are they ????

  4. #4
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Dropdown List value triggers macro.

    I'm Sorry .. I did create the macros however they don't have any code in them as yet ... so the following code is in module1
    Please Login or Register  to view this content.
    the goal is simply to prompt the user for a value and place it in C47 if they select option 2 from the list.

  5. #5
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Dropdown List value triggers macro.

    As you've likely guessed I'm not a programmer .. having created the empty macros as defined above it now errors out on this line

    Please Login or Register  to view this content.
    Method 'Range' of object'_Worksheet' failed

    is the error message.
    Last edited by TJ Saulnier; 05-09-2013 at 11:16 AM.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dropdown List value triggers macro.

    Change the code as shown in red:-
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Dropdown List value triggers macro.

    That's going to do it. It works fine now and I very much appreciate the assistance MickG. I had to make a small adjustment to the data validation for the dropdown but it works perfectly ... thanks again and have a great day.

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dropdown List value triggers macro.

    Your welcome
    Regrds Mick

+ 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