PDA

View Full Version : Solved: how can i code the micro to copy cell value to deferment row?



rrosa1
11-20-2010, 04:49 AM
Hi Guys,
Just wondering if someone could help me ...
i have the data which need some re arranging as u can see in attached sample wb
can some one help. its appreciated.
u can find the data in Sep-10 sheet and i need to arrange as in the after sheet.
and delete those empty row

Bob Phillips
11-20-2010, 05:11 AM
Public Sub ProcessData()
Dim Lastrow As Long
Dim DateRow As Long
Dim i As Long

Application.ScreenUpdating = False

With ActiveSheet

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

DateRow = i
Do While Not IsDate(.Cells(DateRow, "A").Value)

DateRow = DateRow - 1
Loop

.Cells(DateRow + 2, "H").Resize(i - DateRow - 1).Value = .Cells(DateRow, "A").Value
.Rows(DateRow).Resize(2).Delete
i = DateRow
Next i
End With

Application.ScreenUpdating = True
End Sub

rrosa1
11-20-2010, 07:31 PM
hi xld
thank you very much