Try this code
![]()
Sub Test() Dim a, v, i As Long, c As Integer c = 1 'First Column In Sheet2 (Change To Suit) a = Worksheets("Sheet1").Range("A2:B" & Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row).Value With CreateObject("Scripting.Dictionary") .CompareMode = 1 For i = LBound(a) To UBound(a) If .Exists(a(i, 1)) Then .Item(a(i, 1)) = .Item(a(i, 1)) & Chr(2) & a(i, 2) Else .Item(a(i, 1)) = a(i, 1) & Chr(2) & a(i, 2) End If Next i For Each v In .Items Worksheets("Sheet2").Cells(1, c).Resize(UBound(Split(v, Chr(2))) + 1).Value = Application.Transpose(Split(v, Chr(2))) c = c + 1 Next v End With End Sub
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Thanks a lot it worked...also is there any basics or tutorials available to learn vba macros.Please help
You're welcome. Glad I can offer some help
There is a sticky thread at the forum that has a lot of links to useful tutorials and also use Google to search
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks