Function - Increase date by 14 days??

J

James

I have a word document (invoice) that mail merges in an
Invoice Date.

However I would love to be able to create another field
called PAYMENT DATE. Which would be the Invoice Date + 14
days.

Is there a function I can use to create such a date???

Regards

James Terrington
 
J

John Grierson

Hi James

You could write a little macro such as:

Sub AdvanceDate()
Dim FirstDate As Date ' Declare variables.
Dim IntervalType, PayDate As String
Dim Number As Integer
FirstDate = Date ' uses today's date
IntervalType = "d" ' "d" specifies days as interval.
Number = 14 ' the number of days to advance
PayDate = DateAdd(IntervalType, Number, FirstDate)
End Sub

and then further refine it to insert it in the .doc

John
 

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