Static date auto entry

ritagail

New Member
Joined
Jul 28, 2009
Messages
24
Hello Excel World,

I have a workbook full of templates and when the workbook is opened I would like for the date field (cell d4) to auto enter a static (one that does not change) into the cell. Can someone please help the code to do this. I can get the date to populate but it changes to the current date each time the workbook is opened. After wasting a day trying to get this on my own I am turning to the true guru's! :confused:

Thank you!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hello Excel World,

I have a workbook full of templates and when the workbook is opened I would like for the date field (cell d4) to auto enter a static (one that does not change) into the cell. Can someone please help the code to do this. I can get the date to populate but it changes to the current date each time the workbook is opened. After wasting a day trying to get this on my own I am turning to the true guru's! :confused:
You would need to test the cell first to see if it was empty or not...

If Sheets("Sheet1").Range("D4") = "" Then Sheets("Sheet1").Range("D4").Value = Date

Note: You did not say what sheet the cell D4 was on, so I assumed Sheet1 in my example above.
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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