hey everyone the following sub generates dates in cells a2,b2 and returns the result in c2
i need to apply the sub in to colummn A and column B any ideas ?
my data have the form below and i have almost 10.000
A B
[TABLE="width: 165"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]startdate[/TD]
[TD]enddate[/TD]
[/TR]
[TR]
[TD="align: right"]2013-09-08[/TD]
[TD="align: right"]2013-11-08[/TD]
[/TR]
[TR]
[TD="align: right"]2013-09-22[/TD]
[TD="align: right"]2013-11-03[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 265"]
<colgroup><col span="3"><col></colgroup><tbody>[TR]
[TD="colspan: 2"]
Sub flight()[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim FirstDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim LastDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim NextDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Dim r As Long[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]FirstDate = Range("A2").Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]LastDate = Range("B2").Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]NextDate = FirstDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Range("c2").Select[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]'selection of columns within one row[/TD]
[/TR]
[TR]
[TD="colspan: 3"]Do Until NextDate > LastDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"] ActiveCell.Value = NextDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"] ActiveCell.Offset(1, 0).Select[/TD]
[/TR]
[TR]
[TD="colspan: 3"] NextDate = NextDate + 7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loop[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]End Sub[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
i need to apply the sub in to colummn A and column B any ideas ?
my data have the form below and i have almost 10.000
A B
[TABLE="width: 165"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]startdate[/TD]
[TD]enddate[/TD]
[/TR]
[TR]
[TD="align: right"]2013-09-08[/TD]
[TD="align: right"]2013-11-08[/TD]
[/TR]
[TR]
[TD="align: right"]2013-09-22[/TD]
[TD="align: right"]2013-11-03[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 265"]
<colgroup><col span="3"><col></colgroup><tbody>[TR]
[TD="colspan: 2"]
Sub flight()[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim FirstDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim LastDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Dim NextDate As Date[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Dim r As Long[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]FirstDate = Range("A2").Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]LastDate = Range("B2").Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]NextDate = FirstDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Range("c2").Select[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]'selection of columns within one row[/TD]
[/TR]
[TR]
[TD="colspan: 3"]Do Until NextDate > LastDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"] ActiveCell.Value = NextDate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"] ActiveCell.Offset(1, 0).Select[/TD]
[/TR]
[TR]
[TD="colspan: 3"] NextDate = NextDate + 7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loop[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]End Sub[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]