How to transpose these data in Excel 2010?

zicitron

New Member
Joined
Apr 21, 2013
Messages
22
Hi all,

I am using Excel 2010. I have a set of data as shown in the image below:

table1.jpg


I need to reformat the data so that I have ONLY 2 columns, namely "RN" and "PKG REV". Thus I need all the figures relating to "RN" to fall into the new "RN" column and same thing for "PKG REV".

Is there a way to transpose this data? The "transpose" option in the "Paste Special" dialog box does not seem to be the right way.

Thanks for your help!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Here,Try This Code:
Code:
Sub ReformatData()
For i = 3 To Cells(1, Columns.Count).End(xlToLeft).Column Step 2
    Range(Cells(2, i), Cells(Cells(Rows.Count, i).End(xlUp).Row, i)).Select
    Selection.Copy
    Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1).PasteSpecial
    Application.CutCopyMode = False
Next
For C = 4 To Cells(1, Columns.Count).End(xlToLeft).Column Step 2
    Range(Cells(2, C), Cells(Cells(Rows.Count, C).End(xlUp).Row, C)).Select
    Selection.Copy
    Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2).PasteSpecial
    Application.CutCopyMode = False
Next
Range(Cells(1, 3), Cells(Cells(Rows.Count, 1).End(xlUp).Row, Cells(1, Columns.Count).End(xlToLeft).Column)).Delete
End Sub
ZAX
 
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,903
Members
449,477
Latest member
panjongshing

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top