+ Reply to Thread
Results 1 to 7 of 7

Automatically populate today's date

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    91

    Automatically populate today's date

    Hey Guys,

    Not sure if this is possible or not:

    Say we're working with 2 cells, A1 and B1, both initially blank.

    If there an equation that would allow A1 to populate with today's date once B1 is populated with something?

    The TODAY() function wouldn't work because then the date would change each day. I'd want it to stay static.

    Any ideas?

    Thanks!

  2. #2
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,249

    Re: Automatically populate today's date

    You'll need a little bit of VBA.

    Right click the worksheet tab, and click "View Code"

    In the module which appears, enter the following:
    Please Login or Register  to view this content.
    Click File > Close and Return to Microsoft Excel

    Done
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Automatically populate today's date

    Awesome thanks!

    What if I wanted it to work for any row?

    aka, if I fill in B1 I get a date in A1; fill in B2 get a date in A2; etc.

    I tried changing the range in the code, but then it populated every cell in column A in that range when I just populated B1.

  4. #4
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Automatically populate today's date

    Looks like a simple loop worked!

    Please Login or Register  to view this content.
    Thanks again Olly

  5. #5
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,249

    Re: Automatically populate today's date

    In that case, change the code to:
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,249

    Re: Automatically populate today's date

    Just noticed your loop - that will be very slow! Try the amendment I just posted

  7. #7
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    91

    Re: Automatically populate today's date

    Even better!!

+ 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] Listbox in userform to populate with all rows containing the Date today AND 2 weeks prior
    By cath1509 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2013, 08:50 PM
  2. [SOLVED] help!! Need Sheet2 to auto populate with dates that are today's date or 90 days out
    By JennK in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2012, 07:33 PM
  3. Auto-populate Today's Date?
    By Ocean Zhang in forum Excel General
    Replies: 1
    Last Post: 03-12-2011, 11:23 AM
  4. Automatically prompt for today’s date
    By kdc1336 in forum Excel General
    Replies: 2
    Last Post: 08-11-2010, 06:51 AM
  5. Setting today's date automatically in Excel.
    By Ezlpo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-11-2005, 11:06 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