today + 30 days

K

Karl E. Peterson

Petar said:
I need MS Word macro that shows date: today + 30 days. Is it hard to
do?

About as simple as they come...

Public Function NowPlus30() As Date
NowPlus30 = Now + 30
End Function

If you don't want it *exactly* +30, but just want the date, you can modify it like:

Public Function TodayPlus30() As Date
TodayPlus30 = DateValue(Now + 30)
End Function

Later... Karl
 
G

George Nicholson

Selection.TypeText Text:=Format(DateAdd("d", 30, Now()), "mmmm dd, yyyy")

The DateAdd function adds 30 days to today
The Format function handles how the resulting date/time value is displayed.

HTH,
 
P

Petar Popara

Thank you all.

Is there a way to put macro in the middle of Word text and then just to open
Word doc, run macro once and it will enter new date in 5 locations in my
doc?
 
J

Jef Gorbach

havent looked, but suspect you could adapting the previous answers as an
insert fieldcode in each location??
 
P

Petar Popara

What does it mean "insert fieldcode"? How can i do that? Where in the menu
is it?

Thank you very much.
 

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