+ Reply to Thread
Results 1 to 5 of 5

run macro after 4 digits entered

  1. #1
    Registered User
    Join Date
    09-21-2009
    Location
    southeast US
    MS-Off Ver
    Excel 2003
    Posts
    3

    run macro after 4 digits entered

    I have a macro that is used several times a day. Four digits are entered in cell E5, then I press Enter, then click on an icon that has a macro assigned to it. Is there a way to trigger the macro after simply entering the four digits? Or can the macro be triggered after entering the four digits then pressing Enter? Thanks in advance.
    Last edited by gopcs; 09-21-2009 at 04:18 PM. Reason: Solved

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: run macro after 4 digits entered

    Hi,

    This in the worksheet module:

    Please Login or Register  to view this content.
    will trigger the subroutine bob when cell E5 is changed.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    09-21-2009
    Location
    southeast US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: run macro after 4 digits entered

    Thank you for the quick reply.
    I must be doing something wrong. When I enter 4 digits in E5 and press Enter, nothing happens.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: run macro after 4 digits entered

    The macro Dave gave you goes in the worksheet module... so you right-click the worksheet tab and select View Code, then paste his code there, in the VBE editor.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    09-21-2009
    Location
    southeast US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: run macro after 4 digits entered

    Wow - That did it! Thanks!!!

+ 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