# Converting Multiple Rows to One with Multiple Colums

Closed
Coools65 Posts 1 Registration date Tuesday December 16, 2014 Status Member Last seen December 16, 2014 - Dec 16, 2014 at 04:29 PM
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Dec 17, 2014 at 02:52 AM
Hello everyone,

Can anyone help me with converting the below example of data in Excel

venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 810
Dec 17, 2014 at 02:52 AM
`Sub test()Dim myformulaDim class As RangeDim r As Range, unq As Range, cunq As Range, nname As Range, prod As RangeDim uprod As Range, cprod As RangeApplication.ScreenUpdating = FalseRange(Range("A1").End(xlDown).Offset(1, 0), Cells(Rows.Count, "A")).EntireRow.DeleteSet nname = Range(Range("A1"), Range("A1").End(xlDown))Set prod = nname.Offset(0, 2)Set r = Range("A1").CurrentRegionSet unq = Range("A1").End(xlDown).Offset(5, 0)Set uprod = unq.Offset(0, 2)nname.AdvancedFilter xlFilterCopy, , unq, Trueprod.AdvancedFilter xlFilterCopy, , uprod, TrueSet unq = Range(unq.Offset(1, 0), unq.End(xlDown))Set uprod = unq.Offset(0, 2).Resize(prod.Rows.Count)uprod.Copyuprod(1, 1).Offset(-1, -1).PasteSpecial Transpose:=Trueuprod.ClearSet uprod = Range(unq(1, 1).Offset(-1, 1), unq(1, 1).Offset(-1, 1).End(xlToRight))For Each cunq In unqFor Each cprod In uprodmyformula = "=index(" & r.Columns("d:d").Address & ",match(1,(" & nname.Address & "=" & cunq.Address & ")*(" & prod.Address & "=" & cprod.Address & "),0),1)"Application.Evaluate (myformula)Application.Intersect(Rows(cunq.Row), Columns(cprod.Column)) = Application.Evaluate(myformula)NextNextApplication.ScreenUpdating = TrueMsgBox "macro over. see below data"End Sub`