decadence
Well-known Member
- Joined
- Oct 9, 2015
- Messages
- 525
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Hi I am trying to combine Rows based on duplicate values but need to comma delimit one columns of cells at the same time, Currently I am using the code below however it takes a long time when there is a lot of data, can someone help make this process faster please
VBA Code:
Sub CombineRows()
'
Dim j As Long, c As Range
Application.ScreenUpdating = False
j = 1
Do While j < ActiveSheet.UsedRange.Rows.Count
Set c = Cells(j, 4)
If Not c.Value = "" Then
If c.Value = c.Offset(1).Value Then
With c
.Offset(, 2).Value = .Offset(, 2).Value & "," & .Offset(1, 2).Value
.Offset(1).EntireRow.Delete
End With
Else
j = j + 1
End If
End If
Loop
Application.ScreenUpdating = True
End Sub