Bi-weekly date calculation

  • Thread starter Thread starter rocketslinger
  • Start date Start date
R

rocketslinger

How can I programmatically calculate each bi-weekly occurrance in a
worksheet based on a start date of lets say...01/09/2004 for the whole
year?
 
How can I programmatically calculate each bi-weekly occurrance in a
worksheet based on a start date of lets say...01/09/2004 for the whole
year?

A1: 01/09/2004
A2: =A1+14

Copy/drag down as needed


--ron
 
-----Original Message-----
How can I programmatically calculate each bi-weekly occurrance in a
worksheet based on a start date of lets say...01/09/2004 for the whole
year?

Guess it depends on what you are trying to do... If all
you need is a range of cells with the dates in them, just
make a formula and add 14 to the date! If you need to use
program code (VBA) to somehow work with those dates, then
this would do it:

Sub BiWeeklyDates(StartDate as Range)
Dim NewDate as Date
NewDate = StartDate + 14
While NewDate <= Date(Year(StartDate).Value,12,31)
' Put any code you need here to work with the
calculated date
NewDate = StartDate + 14
Wend
End Sub
 
Back
Top