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
<colgroup><col><col></colgroup><tbody>
</tbody>
<colgroup><col span="3"><col></colgroup><tbody>
</tbody>
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
startdate | enddate |
2013-09-08 | 2013-11-08 |
2013-09-22 | 2013-11-03 |
<colgroup><col><col></colgroup><tbody>
</tbody>
Sub flight() | |||
Dim FirstDate As Date | |||
Dim LastDate As Date | |||
Dim NextDate As Date | |||
Dim r As Long | |||
FirstDate = Range("A2").Value | |||
LastDate = Range("B2").Value | |||
NextDate = FirstDate | |||
Range("c2").Select | |||
'selection of columns within one row | |||
Do Until NextDate > LastDate | |||
ActiveCell.Value = NextDate | |||
ActiveCell.Offset(1, 0).Select | |||
NextDate = NextDate + 7 | |||
Loop | |||
End Sub |
<colgroup><col span="3"><col></colgroup><tbody>
</tbody>