Bi-weekly date calculation

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?
 
R

Ron Rosenfeld

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
 
K

K Dales

-----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
 

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