+ Reply to Thread
Results 1 to 6 of 6

Input date in cell based on another cell without updating the date

  1. #1
    Forum Contributor
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    Home 2010
    Posts
    122

    Input date in cell based on another cell without updating the date

    I've done this before in another application, so I don't know why this is so difficult right now. I have a spreadsheet, and when I put a value in a cell, I want today's date to pop in another cell, but I don't want the date to update to today when I re-open the spreadsheet at a later date.

    Similar to this thread: http://www.excelforum.com/excel-gene...eadsheets.html

    The only difference is, my autofill of the date is dependent upon the contents of another cell. I know I have to do VBA for this, but I don't know the function to use. I thought it would be like this:

    Please Login or Register  to view this content.
    I guess I just don't know how to use the Target parameter. Plus, I need to avoid the infinite loop, which means I need code to only look for change in cell C4, rather than the whole sheet.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Input date in cell based on another cell without updating the date

    Target is the cell changed.

    Please Login or Register  to view this content.
    If the cell activated and updated is C4, the code runs. EnableEvents is set to False for the duration of the code because Worksheet_Change is an Event itself, and by updating the worksheet it would trigger itself so while the code runs no Events will be called.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    Home 2010
    Posts
    122

    Re: Input date in cell based on another cell without updating the date

    Other than the missing "Then", the code compiles. Nothing happens when I type something in cell C4 though.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Input date in cell based on another cell without updating the date

    Are you placing the code on the sheet it applies to? If this is for Sheet1 for example, the code must be on Sheet1 in the project explorer. Not in a module.

  5. #5
    Forum Contributor
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    Home 2010
    Posts
    122

    Re: Input date in cell based on another cell without updating the date

    That did it Thank you so much!

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Input date in cell based on another cell without updating the date

    No problem

+ 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. [SOLVED] Updating userform based upon input cell - Issues moving reworked code
    By Chardo in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-18-2014, 11:55 AM
  2. Replies: 3
    Last Post: 08-28-2013, 09:26 AM
  3. Input date, click CommandButton, new date appears in the following cell
    By adamj1910 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2012, 10:59 AM
  4. [SOLVED] Date Filter based on Cell Input - single date or range of dates
    By babaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 10:32 AM
  5. updating a cell with a week number based on the system date
    By SRussell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-05-2008, 03:14 PM

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