View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Reorganising Data

On Sep 20, 11:43 am, Gord Dibben <gorddibbATshawDOTca wrote:
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.


Gord, that most certainly could be the culprit. Dolphy, please let me
know if Gord's edited code works for you. Thanks Gord!