Breaking out Dates from a Date Range

W

WPNX777

Not sure how to do this or if it can be done. Im am trying to manipulate
data from a Project Management download. In my spreadsheet i have 3 columns;
a task, a Start Date and a End Date (EX: Build House; Start 1/1/08; End
2/1/08).

Is there a way that Excel can look at the start and end dates and then
populate that task for each day it will be done as seperate line items? (EX
Build HOuse on 1/1/08, 2nd row = Build House on 1/2/08, 3rd row = Build House
on 1/3/08,,,etc).

I dont want to do this manually. Please Help. Thanks.
 
B

Bob Phillips

Public Sub ProcessData()
Dim i As Long
Dim LastRow As Long
Dim NumRows As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 1 Step -1

If .Cells(i, "B").Value < .Cells(i, "C").Value Then

NumRows = .Cells(i, "C").Value - .Cells(i, "B").Value
.Rows(i + 1).Resize(NumRows - 1).Insert
.Cells(i + 1, "A").Resize(NumRows).Value = .Cells(i,
"A").Value
.Cells(i, "B").AutoFill .Cells(i, "B").Resize(NumRows + 1)
.Cells(i, "C").ClearContents
End If
Next i

End With

End Sub
 
Top