Reorganising Data
Your syntax error is probably coming from the line-wrapping in the post.
Try this revision.
Sub consil()
Dim r As Long, bRow As Long
bRow = Cells(Rows.Count, 1).End(xlUp).Row
For r = 2 To bRow
If IsEmpty(Cells(r, 1)) Then Exit For
If Cells(r, 1).Text = Cells(r, 1).Offset(1, 0).Text Then
Cells(r, Range("IV" & r).End(xlToLeft).Offset(0, _
1).Column) = _
Cells(r, 1).Offset(1, 1).Text
Cells(r, 1).Offset(1, 1).EntireRow.Delete
r = r - 1: bRow = bRow - 1
End If
Next
End Sub
Gord Dibben MS Excel MVP
On Wed, 19 Sep 2007 21:14:06 -0700, Dolphy wrote:
I tried using the exact same data, I'm still getting the sytax error.
|