+ Reply to Thread
Results 1 to 10 of 10

Auto populated "frozen" date based on cell value.

  1. #1
    Registered User
    Join Date
    11-19-2018
    Location
    Houston
    MS-Off Ver
    1810
    Posts
    58

    Auto populated "frozen" date based on cell value.

    Hey guys, I've been working on a worksheet and just realized that my Today() function changes daily.. I've been researching and realized that the only way to make it a fixed date that wont change is by using VBA. Hopefully you can help!?

    I have column L:L set up with a drop down list, I want P:P to auto populate a fixed date when the user selects "Complete" in L:L.

    For example, if the user selects complete in $L7 then $P7 should populate today's date. The key is that the date doesn't change anymore. I need the dates fixed for filtering and other formula purposes.

    Thanks in advanced!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Auto populated "frozen" date based on cell value.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-19-2018
    Location
    Houston
    MS-Off Ver
    1810
    Posts
    58

    Re: Auto populated "frozen" date based on cell value.

    Ok, sorry about that. Make's sense to attach the file. I made a sample copy to avoid the size of the file.

    I was planning on just modifying the code to work for the other cells. But now that you have the file here's how I wanted it to work:

    When the user enters "Complete" in $L7 then the date should populate in $P7, the same go's for the others if $M7 = "complete" then $Q7 = date, if $N7 = "Complete" then $R7 = date.

    The only one that ends up being different is $O7. I want to capture the date that the a new line is entered. So it would be: if $C7 <> "" then $O7 = date.

    The key is that the dates stay fixed or frozen and don't change day by day, and it should work through the entire column O:O, P:P, Q:Q, R:R
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Auto populated "frozen" date based on cell value.

    I think this will do the job. There's no event for adding a new row so it works on the basis of typing the job number

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-19-2018
    Location
    Houston
    MS-Off Ver
    1810
    Posts
    58

    Re: Auto populated "frozen" date based on cell value.

    Looks like it works! I'll enter a sample order and check it tomorrow to make sure the date stays fixed. Thanks for the help!!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Auto populated "frozen" date based on cell value.

    If you were to re-enter the job number, the date would change. Maybe test column O for being blank too.

  7. #7
    Registered User
    Join Date
    11-19-2018
    Location
    Houston
    MS-Off Ver
    1810
    Posts
    58

    Re: Auto populated "frozen" date based on cell value.

    Actually, im seeing that if I enter something in column C then I get a date on column O..

    It should be: if i enter any text in column D then the date populates in columns P.

    I tried playing around with the code you gave me but I cant figure it out.

    Also,
    If column O = "Complete" then column S should populate the date also.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Auto populated "frozen" date based on cell value.

    That would be because you said
    The only one that ends up being different is $O7. I want to capture the date that the a new line is entered. So it would be: if $C7 <> "" then $O7 = date.
    Post #3 paragraph 4.

    Look at the code ... it shouldn’t take too much effort for you to get it to work the way you want rather than the way you said. Also, look at the sample you uploaded. That has Job Number in column C, Customer in D and Date entered in O.

    The code sets a "range of interest", rInterest, which includes all of columns L:N. It then checks for single cell changes in that range and, if "complete" is entered, it puts the date in the appropriate column P to R as described in the post #3 as you stated here:

    The key is that the dates stay fixed or frozen and don't change day by day, and it should work through the entire column O:O, P:P, Q:Q, R:R
    Have a go at adjusting the relevant cell and column references yourself.

  9. #9
    Registered User
    Join Date
    11-19-2018
    Location
    Houston
    MS-Off Ver
    1810
    Posts
    58

    Re: Auto populated "frozen" date based on cell value.

    Very odd. The first time I used your code it wasn't working and now that I tried it again it worked. lol I must have changed something without realizing. Thanks for the help!!!

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Auto populated "frozen" date based on cell value.

    You're welcome. Thanks for the rep.

+ 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] If cell contains "No", adjacent cells auto-populate "NA"
    By chaijing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2016, 04:41 AM
  2. Replies: 9
    Last Post: 03-05-2016, 12:53 AM
  3. Replies: 3
    Last Post: 06-05-2015, 01:55 PM
  4. [SOLVED] Auto-populate "Yes" "No" based on multiple criteria.
    By jtmoore in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:12 AM
  5. Auto "Page Numbering" in a "specific Cell"
    By BigChuckMeister in forum Excel General
    Replies: 2
    Last Post: 04-08-2013, 05:25 PM
  6. [SOLVED] Name Range "Prev3Mos" "Next3Mos" based on todays date
    By MaddyG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2012, 12:31 AM
  7. Replies: 2
    Last Post: 10-30-2012, 06:08 PM

Tags for this Thread

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