Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Calculated Dates.

Calculated Dates

Written by Allen Wyatt (last updated September 14, 2019)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


2

John asked if there is a quick way to put a calculated date into a letter created in Word. He wanted to send out mail-merged letters with a date that is 30 days after the date on which the letters were created.

Unfortunately, there is no native way to do this in Word. For instance, there is no field code you can use to insert a calculated date. If you are using Excel or Access as your data source for the mail merge, the simplest solution may be to just add a field in the data source that shows the calculated date. (It is very easy to do this in both Excel and Access.) The data source field can then be placed in the mail-merge document and everything is set.

If you want to stick with Word and cannot modify the data source (perhaps someone else supplies it), then you can use a macro to insert the future date. The following VBA macro will do the trick:

Sub FutureDate()
    Selection.TypeText Text:=Format(Date + 30, "mmmm d, yyyy")
End Sub

This macro determines today's date, adds 30 days to it, formats it as specified in the format string ("mmmm d, yyyy") and inserts it into the document. If you assign this macro to a shortcut key, you can quickly insert your future date whenever you want.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11556) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Calculated Dates.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Vertical Lines in Word

Lines can help to organize the data on a page or make certain points clearer. Word provides several different ways you ...

Discover More

Recovering Macros from Corrupted Workbooks

Workbooks get corrupted from time to time; that's a fact of life in an Excel world. If those corrupted workbooks contain ...

Discover More

Calculating the First Business Day of the Month

Want to know which day of the month is the first business day? There are a few ways you can check to make sure the date ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Highlight Words from a Word List

Do you need to highlight certain words in a document, and aren't quite sure how to go about it? Using the techniques ...

Discover More

Changing the Format of Existing Dates

There are a myriad of ways in which a date can be formatted: day first, month first, number of digits in the year, etc. ...

Discover More

Understanding Variables

Variables are used quite frequently in programming, and VBA programming is no exception. Each variable can have a data ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2022-02-03 00:00:46

Paul Butler

Hi, I have a need for a variation on this.

I want to create a travel itinerary that has a number of headers saying something like "Day 1 - Weds 15 July - blah blah..." and the next header "Day 2 - Thurs 16 July - blah blah..." etc

Normal headers in word allows me to add the "Day nn - ", but I would like to calculate the date from a starting date.

The objective is to be able to change the start date and have the following dates get re-calculated.

Hopefully this makes sense? BTW, I am not very proficient in VBA or Truescript.

PGB


2019-09-18 13:47:42

bbwq

The company I work for uses a program that generates all sorts of common documents, but it has some... flaws. F'rinstance, if I generate a letter that references $5,000.00, no matter how I enter it in the program, it inserts it as "5000". I have figured out the field code to make it format to $5,000.00, so that's all good. But I'm having a similar problem with dates and I can't figure out how to (or if it's possible to) fix that one. Basically, it generates dates as "Sep 18, 2019". Fine in a form, annoying in a letter. Is there any way to tell a word document to change Sep to September, Jul to July, etc?


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.