dates in advance

S

Sa

Is there a way to insert a date in advance in the format you like through
insert/date and time? I am just curious.
 
M

Mark Tangard

Hi Sa,

Not through the standard menu, but a very small macro could
do it, and you could then assign the macro to a keyboard
shortut or menu item. For example, here's a macro that'll
type the date 14 days from now, in U.S. format:

Selection.TypeText Format(Now + 14, "MMMM d, yyyy")

Or here's one that'll *ask* you how many days in advance you
want the date, the type it in short format (e.g., 9/9/03):

Dim NumDays As Long
Asker:
On Error GoTo oops
NumDays = InputBox("How many days in advance?")
Selection.TypeText Format(Now + NumDays, "M/d/yy")
Exit Sub
oops:
Err.Clear
MsgBox "Must enter a number.": GoTo Asker

If you've never used macros, don't be scared of them. They
can save you tons of time for almost anything you do often.
For info on using macros offered to you in newsgroups, see:
http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm

For info on assigning macro to a hotkey or toolbar menu:
http://www.mvps.org/word/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm
http://www.mvps.org/word/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top