Updating date automatically

adamsm

Active Member
Joined
Apr 20, 2010
Messages
444
Hi anyone,

I need to get the worksheets date updated when day changes. What would be efficient way to do that?

Here is the current code that I'm using in ThisWorkbook Module of my Workbook.
Code:
Sheets("New").Range("M14,O11") = Date

Any help on this would be kindly appreciated.

Thanks in advance.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I'm not sure I understand what you are trying to update here.

=TODAY()

in a cell

is the obvious answer but I think maybe you're looking for something more complicated???
 
Upvote 0
What I'm trying to get is the workbook to update the date when the day changes without closing the workbook?

Will your formula do that?
 
Upvote 0
What I'm trying to get is the workbook to update the date when the day changes without closing the workbook?

Will your formula do that?

This formula always gives what today's date is and so that cell will update to today. Do you mean maybe that you want the filename to change or something? Sorry if I'm being dense
 
Upvote 0
I mean would it change the date to the current date at 12:00 ? even if the workbook is not closed?
 
Upvote 0
Yes, as long as the calculation is not set set to manual or something, I'm pretty sure it should update fine.

I have checked this with the NOW() function which is the same as TODAY() except that it includes the current time, and yes this does update live on the document even when it is open.
 
Last edited:
Upvote 0
Thanks for the help. The calculation is set to automatic. So according to you there are no worries.
 
Upvote 0
You might want to put something like this:


Code:
Private Sub Workbook_Open()
Application.OnTime Now() + TimeValue("[COLOR=red]00:10:00[/COLOR]"), "calcsub"
End Sub

in the workbook module and then in a normal module
Code:
Sub calcsub()
Calculate
End Sub

This runs a calculation every 10 minutes - ensuring that the TODAY() cell is updated. You can adjust the time setting in red above
 
Upvote 0
Even with calculation set to automatic a formula will not auto re calculate until the workbook has been closed and re opened or the spreadsheet re calculates.

In the case of =today() when the clock hits > midnight tonight the formula will not just update this will only re-calculate when the sheet is re calculated by entering a cell then pressing enter key.

Or by pressing F9 to do an auto update of the formula.

If you were going to come into work next day and change something on that sheet the formula would re calc...However if this isnt the case then you would need to force the update by pressing F9 or re calculting the sheet.

Cheers
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top