Find duplicates in one column and concatenate values from another column
- kleo
- Thread is marked as Resolved.
-
-
-
Try:
Code
Display MoreSub ConcatValues() Application.ScreenUpdating = False Dim srcRng As Range, i As Long, v As Variant, lRow As Long, c As Range, txt As String lRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row v = Range("B2:B" & lRow).Value For i = LBound(v) To UBound(v) Range("A1").AutoFilter 2, v(i, 1) Set srcRng = Range("A2:A" & lRow).SpecialCells(xlVisible) For Each c In srcRng txt = txt & c.Value & ", " Next c txt = Left(txt, Len(txt) - 2) Range("C" & i + 1).Value = txt txt = "" Next i Range("A1").AutoFilter Application.ScreenUpdating = True End Sub
-
-
Worked perfect!
Thank you!
-
-
You are very welcome.
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!