How to group rows and transpose them to columns

Hello,
I am posting here in hope that someone might be able to help me find a solution to my issue. Unfortunetly, I cannot display the actual database(privacy policy) but here is an example of the data I am working on.

I am scraping row-oriented data from 2 links (2 different ids, but same file format). The extracted result looks like this :
Column-0 Column-1
Name name_1
Birthday birthday_1
Address address_1
Name name_2
Birthday birthday_2
Address address_2

I need to transpose them on excel in order to have the following output:
Name Birthday Address
name_1 birthday_1 Address_1
name_2 birthday_2 Address_2

Could someone please help me solve this issue,
Thank you very much!

@smaherzi

Can you please check this link. This could help you a lot for your question.

Thanks,
Arunachalam.

1 Like

Are Macros available to you? You could use the Execute VBA actitivity and apply some code to do it that way. See below for something of an example, just update the ranges:

Sub GroupTransposeColToRow()

    Range("A1:B5").Select
    Selection.Copy
    Selection.Columns.Group
    Range("D1").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
    Range("D:E").Select
    Selection.Copy
    Range("G1").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=True

End Sub

Thank you ! It finally worked :slight_smile:
I used the ‘Transpose.xaml’ file which was uploaded on the link you gave me.
However, could you please explain why the ‘Column_name’ and ‘Column_number’ are assigned to the following values : ‘Convert.ToChar(65 + modulo).ToString()+Column_Name’ and ‘Convert.ToInt32((Column_Number - modulo) / 26)’

@smaherzi

You are welcome :grinning: . ‘Convert.ToChar(65 + modulo).ToString()+Column_Name’ and ‘Convert.ToInt32((Column_Number - modulo) / 26)’ is use to get the value of column value like Name Birthday and adreess and count the row of value and transpose It’s very simple buddy.
Please make that’s a solution so that our folks will get the info of this query.

Thanks,
Arunachalam.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.