another date question

micfly

Well-known Member
Joined
Sep 8, 2008
Messages
543
I'm trying to show todays date is N38 when the workbook is first opened.

I tried:
Private Sub OnOpen()
Range("N38").Value = Format(Now(), "mm-dd-yy hh:mm")
End Sub

Which wiorks fine but I want to be able to change the date is N38 and have it go back to todays date when the workbook is re-opened.

As of now, when I open it todays date is in there. If I change the date and close the book and re-open it the date I entered manually is still there. I want it to always show todays date when the workbook is first opened but can be changed after the book is opened. hope that makes sense.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
This worked:

Private Sub Workbook_Open()
Sheets("Sheet1").Range("N38").Value = Format(Now(), "mm-dd-yy hh:mm")
End Sub
 
Upvote 0

Forum statistics

Threads
1,206,920
Messages
6,075,575
Members
446,147
Latest member
homedecortips

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