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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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
=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))," ")

23371627204410181841184114211057
20711627167710181734173410661018
19451615167710181637163710661018
1627
1627
1615
2044
1677
1677
1018
1018
1018
1841
1734
1637
1841
1734
1637
1421
1066
1066
1057
1018
1018

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,956
Members
449,096
Latest member
Anshu121

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