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 did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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