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.
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

juz2gud

New Member
Joined
Jan 31, 2014
Messages
41
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)
 

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
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.
 

juz2gud

New Member
Joined
Jan 31, 2014
Messages
41

ADVERTISEMENT

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.
 

juz2gud

New Member
Joined
Jan 31, 2014
Messages
41
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?
 

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,651
Members
414,083
Latest member
Mrsash

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
Top