Date in Template

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
We have several template files that require a date in cell A1 of Sheet1. Is it possible to have VBA include the date based on the computer clock but only one time and that is automatically when the file is opened? The format would be mmmm d, yyyy.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
If you want the date to appear EVERYTIME you open the file, you can simple use ---> =today()
and you can set the date format from FORMAT CELL option of that cell.... That way the date will change everyday, and whenever you open the file, it will show you the CURRENT date

And if you want the cell to show to update the date only ONCE that is the FIRST time the file was opened, and NEVER again. You can simply select the cell and press- -----> "CTRL ;" (Hold CTRL key and press the semicolon symbol)
 
Upvote 0
Thanks. Is there vba for Ctrl semicolon? There is some other code that has to be added and I'd hoped to include it at the start.
 
Upvote 0
There is a VBA for everything my friend, you just need to know. :)
But if you want VBA to do it EVERYTIME, then you just rather use the =today() in that cell.

And if you want VBA to do it ONCE only, you will need to run it once by pressing shortkey or a button that you assign that VBA macro to. in either case you are pressing something (2 keys to generate the macro, or the button to generate the macro) you might just click "ctrl and ;" after selecting that cell.

I am definetly missing something here, otherwise "ctrl ;" should hav solved your problem. Why do you want a VBA for it? even in the most ideal situation, using VBA will only save you ONE keystroke per worksheet, thts it.
 
Upvote 0
No problem, you said there was something else you wanted to have done, which you wanted to add in the start of code if you were doing this through macro?
what was that?
 
Upvote 0
Thanks very much juz2gud. I got it all figured out.

No problem, you said there was something else you wanted to have done, which you wanted to add in the start of code if you were doing this through macro?
what was that?
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,543
Latest member
MartinLarkin

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