Column into Rows

Markovnikov13

New Member
Joined
Jul 1, 2019
Messages
3
I have a very long column going from C1 to C1832 and would like to convert it into 4 rows of 458 values. I am not sure how to do this and any help is appreciated.

An example of what I am trying to do is if I have the following values in my column

4
5
6
7
1
2
3
4

I want to create rows of
4 5 6 7
1 2 3 4
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board!

What cells/rows do you want these values to go into?
 
Upvote 0
How about
Code:
Sub Markovnikov()
   Dim Ary As Variant, Nary As Variant
   Dim x As Long, r As Long, nc As Long, nr As Long
   
   Ary = Range("C1", Range("C" & Rows.Count).End(xlUp)).Value2
   x = Application.RoundUp(UBound(Ary) / 4, 0)
   ReDim Nary(1 To 4, 1 To x)
   For r = 1 To UBound(Ary) Step x
      nr = nr + 1
      For nc = 1 To x
         If nc + r - 1 > UBound(Ary) Then Exit For
         Nary(nr, nc) = Ary(nc + r - 1, 1)
      Next nc
   Next r
   Range("E1").Resize(4, x).Value = Nary
End Sub
 
Upvote 0
Ok, how about
Code:
Sub Markovnikov()
   Dim Ary As Variant, Nary As Variant
   Dim x As Long, r As Long, nc As Long, nr As Long
   
   Ary = Range("C1", Range("C" & Rows.Count).End(xlUp)).Value2
   x = Application.RoundUp(UBound(Ary) / 4, 0)
   ReDim Nary(1 To x, 1 To 4)
   For r = 1 To UBound(Ary) Step 4
      nr = nr + 1
      For nc = 1 To 4
         If nc + r - 1 > UBound(Ary) Then Exit For
         Nary(nr, nc) = Ary(nc + r - 1, 1)
      Next nc
   Next r
   Range("E1").Resize(x, 4).Value = Nary
End Sub
 
Upvote 0
For a non-VBA solution, you can put this formula in cell E1 and copy down to H458:
Code:
=INDIRECT("C" & (ROW()*4)+COLUMN()-8)
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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