+ Reply to Thread
Results 1 to 8 of 8

Auto call a procedure by selecting from a dropdown list

  1. #1
    Registered User
    Join Date
    11-11-2004
    Posts
    57

    Auto call a procedure by selecting from a dropdown list

    Hi All,

    I have a worksheet with a Drop Down list (Set up with Data Validation).

    All I want to do is a call a procedure when a particular option is selected from the list, without have to run the macro manually.

    Can someone help?
    Many thanks,
    Jay3
    Last edited by VBA Noob; 10-30-2008 at 02:18 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jay3,

    Welcome to the Forum!

    Are the names of the macros in this list?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-11-2004
    Posts
    57
    Hi,

    They can be as I'm building something from scratch!

    Basically it's a journal for posting accounting entries, and what I want to do is record serverl basic "Copy and Paste" macros, which will run once the relevant selection is made from the drop down.

    So Yes would be the answer!

    Thanks for replying to my thread

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jay3,

    Add this macro to the worksheet with your validation list. Be sure to change the the cell address in the macro to the cell address of your validation list. Remeber Macro names can't have spaces. If you want to use spaces in the list for better readability, let me know and I'll show you to work around this.
    Please Login or Register  to view this content.
    How to Save a Worksheet Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on the Worksheet's Name Tab for the Worksheet the macro will run on.
    3. Left Click on View Code in the pop up menu.
    4. Paste the macro code using CTRL+V
    5. Make any custom changes to the macro if needed at this time.
    6. Save the macro in your Workbook using CTRL+S

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    11-11-2004
    Posts
    57
    Thanks for that, somethings happening now.

    Can you tell me where I need to paste the following code so that your procedure knows where to look for mine?

    This is the procedure I need to call:

    Please Login or Register  to view this content.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jay3,

    Are you using this to create the list for the Validation Drop Down? Do you have macros already created called: CALL, FREEXP, and VATCON? Which cell do plan to use for the Validation List?

    Sincerely,
    Leith Ross

  7. #7
    Registered User
    Join Date
    11-11-2004
    Posts
    57

    Talking

    Hi

    I've got it to work...thanks!

    Basically from the drop down list I'll select an the macro "INVOICE" and it will paste the the corresponding ledger names into the journal, just leaving it to the person creating the journal to type in the amount of the invoice, reducing the amount of typing.

    If that makes sense?

    I've got it to work now, so thanks for your help, you've been great.

    I posted another thread before re conditional formatting using macros, but no one has responded will you be able to help with that one?

    Thanks!:D

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jay3,

    Excellent work! I'll mark this post solved for you.

    Sincerely,
    Leith Ross

+ 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