Copy Data from Multiple Columns to a Single Column

Sufiyan97

Well-known Member
Joined
Apr 12, 2019
Messages
1,538
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
1601647942545.png


I have data set in Columns H, I and J, and I want to copy all the data in a single column.
Expected result in column G
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try:
VBA Code:
Sub CopyCols()
    Application.ScreenUpdating = False
    Dim LastRow As Long, x As Long
    LastRow = Range("H" & Rows.Count).End(xlUp).Row
    For x = 8 To 10
        Cells(1, x).Resize(LastRow).Copy Cells(Rows.Count, "A").End(xlUp).Offset(1)
    Next x
    Range("A1").Delete
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Try:
VBA Code:
Sub CopyCols()
    Application.ScreenUpdating = False
    Dim LastRow As Long, x As Long
    LastRow = Range("H" & Rows.Count).End(xlUp).Row
    For x = 8 To 10
        Cells(1, x).Resize(LastRow).Copy Cells(Rows.Count, "A").End(xlUp).Offset(1)
    Next x
    Range("A1").Delete
    Application.ScreenUpdating = True
End Sub

Thank you very much! It works perfectly.

Is there any solution without VBA....????
 
Upvote 0
with Power Query (Get&Transform) built in XL2016

Column1Column2Column3Column1
AEIA
BFJB
CGKC
DHLD
E
F
G
H
I
J
K
L

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    T2C = Table.ToColumns(Source),
    C2T = Table.FromList(T2C, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Expand = Table.ExpandListColumn(C2T, "Column1")
in
    Expand
 
Upvote 0
You are very welcome. :) I think that you would need to use the macro or the Power Query suggested by @sandy666.
 
Upvote 0
if you don't care: by rows
Book1
ABCD
1AAEI
2EBFJ
3ICGK
4BDHL
5F
6J
7C
8G
9K
10D
11H
12L
Sheet4
Cell Formulas
RangeFormula
A1:A12A1=IFERROR(INDEX($B$1:$D$4,INT((ROWS($B$1:$B1)-1)/COLUMNS($B$1:$D$4))+1,MOD(ROWS($B$1:$B1)-1,COLUMNS($B$1:$D$4))+1),"")


maybe someone else will give you solution by columns
 
Last edited:
Upvote 0
To do it by columns
+Fluff v2.xlsm
GHIJ
1AAEI
2BBFJ
3CCGK
4DDHL
5E
6F
7G
8H
9I
10J
11K
12L
13 
Main
Cell Formulas
RangeFormula
G1:G13G1=IFERROR(INDEX($H$1:$J$4,MOD(ROWS($H$1:$H1)-1,ROWS($H$1:$J$4))+1,INT((ROWS($H$1:$H1)-1)/ROWS($H$1:$J$4))+1),"")
 
Upvote 0
Solution
with Power Query (Get&Transform) built in XL2016

Column1Column2Column3Column1
AEIA
BFJB
CGKC
DHLD
E
F
G
H
I
J
K
L

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    T2C = Table.ToColumns(Source),
    C2T = Table.FromList(T2C, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Expand = Table.ExpandListColumn(C2T, "Column1")
in
    Expand
Thank you very much for your help!
 
Upvote 0
if you don't care: by rows
Book1
ABCD
1AAEI
2EBFJ
3ICGK
4BDHL
5F
6J
7C
8G
9K
10D
11H
12L
Sheet4
Cell Formulas
RangeFormula
A1:A12A1=IFERROR(INDEX($B$1:$D$4,INT((ROWS($B$1:$B1)-1)/COLUMNS($B$1:$D$4))+1,MOD(ROWS($B$1:$B1)-1,COLUMNS($B$1:$D$4))+1),"")


maybe someone else will give you solution by columns

Thank you again for your time and support!
 
Upvote 0

Forum statistics

Threads
1,215,558
Messages
6,125,507
Members
449,236
Latest member
Afua

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