Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, Stopher!!!!
I have been on vacation ... sorry for the late reply. I will test it asap and let you know how it went. I appreciate it very, very much!!!! KDJ "Stopher" wrote: Made a mistake, this Cells(Cref, 0).Select should be Cells(Cref, 1).Select so.. Sub InsertRows() Dim Startdate As Date Dim EndDate As Date Dim Gap Dim Prow As Integer Dim Cref As Integer Sheets("Sheet1").Select Range("A1").Select Cref = 1 Do Until ActiveCell.Value = "" Startdate = ActiveCell.Value ActiveCell.Offset(0, 1).Activate EndDate = ActiveCell.Value Gap = EndDate - Startdate For i = 0 To Gap Let Prow = Prow + 1 Sheets("Sheet2").Cells(Prow, 1) = Startdate Sheets("Sheet2").Cells(Prow, 2) = Startdate Sheets("Sheet2").Cells(Prow, 3) = ActiveCell.Offset(0, 1).Value Sheets("Sheet2").Cells(Prow, 4) = ActiveCell.Offset(0, 2).Value Startdate = Startdate + 1 Next Cref = Cref + 1 Cells(Cref, 1).Select Loop End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Keeping row number after inserting lines | Excel Worksheet Functions | |||
Inserting new lines with corresponding number | Excel Discussion (Misc queries) | |||
inserting new lines with number | Excel Discussion (Misc queries) | |||
inserting rows without adjusting formula relationships | Excel Discussion (Misc queries) | |||
2 questions - one about inserting the date, other about adding lines. | New Users to Excel |