=today() formula at a cell via macro

sujittalukde

Well-known Member
Joined
Jun 2, 2007
Messages
520
Can a macro be provided which will put today's date to a cell on opening a WB? The user can put any other date to that cell but on reopening of the WB todays date should come to that cell? If I use the formula =today(), the problem is that it the user changes the date nad saves the date, then on reopening the file new dte comes in rather than today's date?
 

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.
Right click on the sheet tab, and go view code. then on the left under Microsoft Excel Objects there will be ThisWorkbook, double click on it it should bring up a white box/screen then paste this in:

Code:
Private Sub Workbook_Open()
    Range("A1").Formula = "=today()"
End Sub

obviously substitute A1 for the cell you want
 
Upvote 0

Forum statistics

Threads
1,214,412
Messages
6,119,365
Members
448,888
Latest member
Arle8907

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