I have two columns one is product SKU's the other is the product fitment. If a sku has more then one fitment it repeats the sku and adds the fitment. I want some way of finding all matching skus and combining the fitments into one sku.
Option Explicit
Sub test()
Dim ws As Worksheet
Dim LR As Long, i As Long
Set ws = Sheets("Before")
Application.ScreenUpdating = False
With ws
LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
For i = LR To 2 Step -1
If .Range("A" & i).Offset(-1, 0).Value = .Range("A" & i).Value Then
.Range("B" & i).Offset(-1, 0).Value = .Range("B" & i).Offset(-1, 0).Value & " | " & .Range("B" & i).Value
.Range("A" & i).EntireRow.Delete
End If
Next i
End With
Application.ScreenUpdating = True
End Sub