how to move data under a columns under 1 ray

mydreamnet

New Member
Joined
Aug 13, 2017
Messages
3
Dear Sir
I need to move column under one column that fast way I can with our cut past because I have huge date
In the picture below you can see the sample



 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Re: how to move data under a columns under 1 ray ????

Welcome to the MrExcel board!

For data set out like in your first image, try this on a copy of the data.

Code:
Sub MoveCols()
  Dim a As Variant, b As Variant
  Dim i As Long, j As Long, k As Long
  
  With Range("E4").CurrentRegion
    a = .Value
    ReDim b(1 To UBound(a, 1) * UBound(a, 2), 1 To 1)
    For j = 1 To UBound(a, 2)
      For i = 1 To UBound(a, 1)
        k = k + 1
        b(k, 1) = a(i, j)
      Next i
    Next j
    .ClearContents
    .Resize(UBound(b), 1).Value = b
  End With
End Sub
 
Upvote 0
Re: how to move data under a columns under 1 ray ????

Dear Sir
should I make a Macro or what should I do

Welcome to the MrExcel board!

For data set out like in your first image, try this on a copy of the data.

Code:
Sub MoveCols()
  Dim a As Variant, b As Variant
  Dim i As Long, j As Long, k As Long
  
  With Range("E4").CurrentRegion
    a = .Value
    ReDim b(1 To UBound(a, 1) * UBound(a, 2), 1 To 1)
    For j = 1 To UBound(a, 2)
      For i = 1 To UBound(a, 1)
        k = k + 1
        b(k, 1) = a(i, j)
      Next i
    Next j
    .ClearContents
    .Resize(UBound(b), 1).Value = b
  End With
End Sub
 
Upvote 0
Re: how to move data under a columns under 1 ray ????

Can you something like this? This is a crazy complicated, yet robust formula. You need to use Cntrl+Shift+Enter. Then copy down. I also inclosed an =ifferror(....." ") to remove error messages. Here is my formula [TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"] =IFERROR(INDEX($B$1:$H$3,MOD(SMALL(IF($B$1:$H$3<>"",(COLUMN($B$1:$H$3)-COLUMN($B$1)+1)*10^9+ROW($B$1:$H$3)-ROW($B$1)+1),ROWS($A$4:A4)),10^9),INT(SMALL(IF($B$1:$H$3<>"",(COLUMN($B$1:$H$3)-COLUMN($B$1)+1)*10^9+ROW($B$1:$H$3)-ROW($B$1)+1),ROWS($A$4:A4))/10^9))," ")

[TABLE="width: 512"]
<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64, align: right"]2337[/TD]
[TD="width: 64, align: right"]1627[/TD]
[TD="width: 64, align: right"]2044[/TD]
[TD="width: 64, align: right"]1018[/TD]
[TD="width: 64, align: right"]1841[/TD]
[TD="width: 64, align: right"]1841[/TD]
[TD="width: 64, align: right"]1421[/TD]
[TD="width: 64, align: right"]1057[/TD]
[/TR]
[TR]
[TD="align: right"]2071[/TD]
[TD="align: right"]1627[/TD]
[TD="align: right"]1677[/TD]
[TD="align: right"]1018[/TD]
[TD="align: right"]1734[/TD]
[TD="align: right"]1734[/TD]
[TD="align: right"]1066[/TD]
[TD="align: right"]1018[/TD]
[/TR]
[TR]
[TD="align: right"]1945[/TD]
[TD="align: right"]1615[/TD]
[TD="align: right"]1677[/TD]
[TD="align: right"]1018[/TD]
[TD="align: right"]1637[/TD]
[TD="align: right"]1637[/TD]
[TD="align: right"]1066[/TD]
[TD="align: right"]1018[/TD]
[/TR]
[TR]
[TD="align: right"]1627[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1627[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1615[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2044[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1677[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1677[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1841[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1734[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1637[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1841[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1734[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1637[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1421[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1066[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1066[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1057[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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