+ Reply to Thread
Results 1 to 7 of 7

Run Macro on cell exit or change

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    Sisters, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Run Macro on cell exit or change

    I have a Workbook with two worksheets: Clients; Client notes
    The Client worksheet has multiple columns, but the two I’m interested in are: Name and Last Contact Date.
    The Client Notes sheet has Name, Contact Date, and Note columns.
    I’m looking for a macro that would run when the Last Contact Date on Clients worksheet is added or changed. I would like the Name and Last Contact Date copied from Clients to the Clients Notes worksheet.
    Any help is appreciated!

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Run Macro on cell exit or change

    This can be accomplished with a worksheet_change event. In VBA editor, if you double-click on the Clients worksheet, you will see pulldowns at the top. Change the one that says "General" to "Worksheet" and then change "SelectionChange" to "Change". With a copy of your book (only needs a small amount of sample data, but real layout) we can help further.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    06-24-2011
    Location
    Sisters, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run Macro on cell exit or change

    Great.
    Here's a sample
    Attached Files Attached Files

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Run Macro on cell exit or change

    Ok so... go to vba editor (Alt-F11), double click the Client Sheet in the project browser, and paste in this code. You will want to format column B on Client Notes as date, or the copied data will end up as a date serial instead of the standard date format. Just highlight the whole column and format.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-24-2011
    Location
    Sisters, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run Macro on cell exit or change

    Great!
    Thanks so much.
    If I wanted the cursor to come to rest in C on ws Client Notes at end of the macro, what code do I add?

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Run Macro on cell exit or change

    after the End If line (so just before End Sub) add,
    Please Login or Register  to view this content.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Run Macro on cell exit or change

    COPCV,

    If you are satisfied with everything now, please mark the post as solved? Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 10-30-2010, 08:07 PM
  2. How do I change cell color upon entry, and exit?
    By Ragdyer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM

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