columns to rows

shyamvinjamuri

Board Regular
Joined
Aug 2, 2006
Messages
175
I have data in 10 columns starting from column A.
How can I put the data in rows? Eg. Data in column a to row 1 etc.

Also, what happens if there are more number of cells with data in a colum than cells available in a row? Can the remaining cells with data be put in a separate sheet?

Can some one help? PLEASE

Rhanks
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I have data in 10 columns starting from column A.
How can I put the data in rows? Eg. Data in column a to row 1 etc.
try
Code:
Sub test()
Dim a, b(), i As Long, ii As Long
With Range("a1").CurrentRegion
      a = .Value
      .ClearContents
End With
ReDim b(1 To UBound(a,2), 1 To UBound(a,1))
For i = 1 To UBound(a,1)
     For ii = 1 To UBound(a,2)
          b(ii,i) = a(i,ii)
     Next
Next
Range("a1").Resize(UBound(b,1), UBound(b,2)).Value = b
End Sub
Also, what happens if there are more number of cells with data in a colum than cells available in a row? Can the remaining cells with data be put in a separate sheet?

Can some one help? PLEASE

Rhanks

Did you know there are 256 columns and 65536 rows?
 
Upvote 0
One way is to highlight the cells and select Paste Special > and check the transpose box at the bottom. This would work best for values rather than formulas methinks

As for your second sheet, aside from doing it manually, I'm sure VBA could help, but not my area I'm afraid
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

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