Convert row one into three column

Closed
Vijay - 20 Jun 2012 à 04:23
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 20 Jun 2012 à 22:31
Dear friends,

Could you please help me to convert below given data into required format
Current situation
12345 60
12345 50
12345 40
12435 60
12435 40
12435 50
Requirement
12345 40 50 60
12435 40 50 60 please do the needful
Related:

1 response

venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 811
20 Jun 2012 à 22:31
see attached file "vijay.xls" which can be downloaded from
http://speedy.sh/37QbQ/vijy.xls

the macro is in the module repeated here



Sub test()
Dim r As Range, unq As Range, cunq As Range, filt As Range, r1 As Range
Dim rdelete As Range, dest As Range, item, amt As Long
Range(Range("a1").End(xlDown).Offset(1, 0), Cells(Rows.Count, "A")).EntireRow.Delete
Range(Range("G2"), Range("G2").End(xlToRight)).EntireColumn.Delete

Set r = Range("a1").CurrentRegion

Set r1 = r.Resize(, r.Columns.Count - 1)
'MsgBox r1.Address
Set unq = Range("a1").End(xlDown).Offset(5, 0)
r1.AdvancedFilter xlFilterCopy, , unq, True
Set unq = Range(unq.Offset(1, 0), unq.End(xlDown))
For Each cunq In unq
item = cunq.Value
r.AutoFilter 1, cunq.Value


Set dest = Cells(Rows.Count, "g").End(xlUp).Offset(1, 0)

'MsgBox dest.Address
dest = item
Range(Range("B2"), Range("B2").End(xlDown)).SpecialCells(12).Copy

dest.Offset(0, 1).PasteSpecial Transpose:=True
ActiveSheet.AutoFilterMode = False
Next cunq



End Sub