ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bi-weekly date calculation (https://www.excelbanter.com/excel-programming/287084-bi-weekly-date-calculation.html)

rocketslinger[_4_]

Bi-weekly date calculation
 
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?


---
Message posted from http://www.ExcelForum.com/


Ron Rosenfeld

Bi-weekly date calculation
 
On Wed, 7 Jan 2004 09:51:42 -0600, rocketslinger
wrote:

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?


---
Message posted from http://www.ExcelForum.com/


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

Copy/drag down as needed


--ron

K Dales

Bi-weekly date calculation
 

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


---
Message posted from http://www.ExcelForum.com/

.


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


All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com