View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Hansen Rick Hansen is offline
external usenet poster
 
Posts: 104
Default Macro to concatenate multiple rows in a column, without selecting each group manually

Mike, here a little bit of code you can try that will get you the results
your looking for. If you have any questions please post me back. Please
note changes where needed,, ie sheet name and etc.

hth Rick (Fairbanks, AK {Land of the Midnight Sun})

=================================================
Sub DeleteUnWantedRows()
Dim ws4 As Worksheet
Dim lrow As Long, cnt As Long
Dim test As Integer

Application.ScreenUpdating = False
Set ws4 = Worksheets("Sheet4")

lrow = ws4.Range("A2").End(xlDown).Row
cnt = lrow
Do
test = ws4.Cells(lrow, 1)
Do
cnt = cnt - 1
If (test = ws4.Cells(cnt, 1)) Then
ws4.Cells(lrow, 1).EntireRow.Delete
lrow = lrow - 1
Else
lrow = lrow - 1
Exit Do
End If
Loop
Loop While (cnt 2)

End Sub

============================================


"MikeM" wrote in
message ...

Sure...here's some sample data in a zip file:


+-------------------------------------------------------------------+
|Filename: SampleData.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4898 |
+-------------------------------------------------------------------+

--
MikeM
------------------------------------------------------------------------
MikeM's Profile:

http://www.excelforum.com/member.php...o&userid=35502
View this thread: http://www.excelforum.com/showthread...hreadid=552694