Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do Until Loop
I have the following
1 - A Start Date 2 - This Date must be incremented by a certain period (months, quarters, semi-annualy etc) each time the Loop passes 3 - Need to write the result into a range 4 - "Max range" to write this in is 100 rows (calculated bewteen two ranges - say A1:A100). loop must stop at 100. Can someone help write this simple code for me tanhks/sgl |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do Until Loop
Taking a course?
Sub DateIncrementSample() Dim i As Integer Dim rtnDate As Date Dim stDate As Date stDate = #1/1/2000# rtnDate = stDate i = 1 Do Until i 100 rtnDate = DateAdd("d", 1, rtnDate) Range("A" & i).Value = rtnDate i = i + 1 Loop End Sub 'After DateAdd(" 'yyyy = Year 'q = Quarter 'm = Month 'y = Day of year 'd = Day 'w = Weekday 'ww = Week 'h = Hour 'n = Minute 's = Second -- Steve "sgl" wrote in message ... I have the following 1 - A Start Date 2 - This Date must be incremented by a certain period (months, quarters, semi-annualy etc) each time the Loop passes 3 - Need to write the result into a range 4 - "Max range" to write this in is 100 rows (calculated bewteen two ranges - say A1:A100). loop must stop at 100. Can someone help write this simple code for me tanhks/sgl |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do Until Loop
Thank you for assistance that worked for me
"AltaEgo" wrote: Taking a course? Sub DateIncrementSample() Dim i As Integer Dim rtnDate As Date Dim stDate As Date stDate = #1/1/2000# rtnDate = stDate i = 1 Do Until i 100 rtnDate = DateAdd("d", 1, rtnDate) Range("A" & i).Value = rtnDate i = i + 1 Loop End Sub 'After DateAdd(" 'yyyy = Year 'q = Quarter 'm = Month 'y = Day of year 'd = Day 'w = Weekday 'ww = Week 'h = Hour 'n = Minute 's = Second -- Steve "sgl" wrote in message ... I have the following 1 - A Start Date 2 - This Date must be incremented by a certain period (months, quarters, semi-annualy etc) each time the Loop passes 3 - Need to write the result into a range 4 - "Max range" to write this in is 100 rows (calculated bewteen two ranges - say A1:A100). loop must stop at 100. Can someone help write this simple code for me tanhks/sgl |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
(Complex) Loop within loop to create worksheets | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |