+ Reply to Thread
Results 1 to 2 of 2

Run Macro on Enter Key if Address = A1

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Run Macro on Enter Key if Address = A1

    Is there a way to call a macro (or just run a few lines of command) if the user hits Enter while the ActiveCell is A1

    edit:
    Actually, the code I'm trying to run doesn't work right itself.
    This is the jist of what I want to do.


    Please Login or Register  to view this content.

    what happene to the code icon?
    Last edited by shg; 01-10-2011 at 05:20 PM. Reason: closing code tag is [/code]

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Run Macro on Enter Key if Address = A1

    Hi carsto;

    Here's 2 ideas off the top of my head.

    1) If the value in A1 changes EVERY time the use hits ENTER, then you can use the Worksheet_Change() event to run the macro.

    2) If the value doesn't necessarily change, then use the the Worksheet_SelectionChange() event to store the address of the selection and check it every time to see if the cell it's coming from is A1.

    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ 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