Columns into one column excel

Are you having difficulty merging two or more Excel columns? Knowing how to combine multiple columns in Excel without losing data is a handy time-saver that allows you to consolidate your data and make your sheet look neater.

First and foremost, you should know that there are multiple ways you can merge data from two or more columns in Excel. Before we get started exploring these different ways, let’s start with a key step that helps the process — how to merge cells in Excel.

If you want to combine Google Sheets data, you can do that easily using Layer. Layer is a free add-on that allows you to share sheets or ranges of your main spreadsheet with different people. On top of that, you get to monitor and approve edits and changes made to the shared files before they’re merged back into your master file, giving you more control over your data.

Install the Layer Google Sheets Add-On today and Get Free Access to all the paid features, so you can start managing, automating, and scaling your processes on top of Google Sheets!

How to Combine Multiple Cells or Columns in Excel Without Losing Data?

Once you have merging cells under your belt, learning how to combine multiple Excel columns into one column becomes intuitive.

Whether you’re learning how to combine two cells in Excel, or ten, one of the main benefits of merging is that the formulae don’t change. Here are the following ways you can combine cells or merge columns within your Excel:

Use Ampersand (&) to merge two cells in Excel

If you want to know how to merge two cells in Excel, here’s the quickest and easiest way of doing so without losing any of your data.

  1. 1. Double-click the cell in which you want to put the combined data and type =
  2. 2. Click a cell you want to combine, type &, and click the other cell you wish to combine. If you want to include more cells, type &, and click on another cell you wish to merge, etc.
  3. 3. Press Enter when you have selected all the cells you want to combine

How to Combine Multiple Excel Columns Into One Screenshot 1

While this is useful for quickly merging data into a single cell, the merged data will not be formatted. This can make data untidy or challenging to read in some instances (e.g. full names or addresses).

If you want to add punctuation or spaces (delimiters), follow the below steps. For this example, let’s put a comma and a space between the first and last name as you would see on a registration list:

  1. 1. Double-click the cell in which you want to put the merged data and type =
  2. 2. Click a cell you want to merge
  3. 3. This time, type &”, ”& before you click the next cell you want to merge. If you want to include more cells, type &”, ”& before clicking the next cell you want to merge, etc.
  4. 4. Press Enter when you have selected all the cells you want to combine

How to Combine Multiple Excel Columns Into One Screenshot 2

As you can see, now your merged data comes out in a neater format, with each piece of data appropriately separated.

Use the CONCATENATE function to merge multiple columns in Excel

This method is similar to the ampersand method, and also allows you to format your merged data. First, you need to use the CONCATENATE function to merge a row of cells:

  1. 1. Insert the =CONCATENATE function as laid out in the instructions above
  2. 2. Type in the references of the cells you want to combine, separating each reference with ,», «, (e.g. B2,», «,C2,», «,D2). This will create spaces between each value.
  3. 3. Press Enter

How to Combine Multiple Excel Columns Into One Screenshot 3

Now that you have successfully merged your cells, you can follow these simple steps to merge multiple columns:

  1. 1. Hover your mouse over the bottom-right corner of the merged cell you just created
  2. 2. When the cursor changes into a + symbol, drag your cursor as far down the column as you want and release it

How to Combine Multiple Excel Columns Into One Screenshot 4

Once you release the mouse, you should see that your merged cell has become a merged column, containing all of the data from your chosen columns.

*The CONCAT function is another formula used for combining data from different cells. However, it is limited to two references and does not allow you to include delimiters.

Use the TEXTJOIN function to merge multiple columns in Excel

This method works only with Excel 365, 2021, and 2019. As you can probably tell, this function is helpful when you want to combine two or more text cells in Excel.

The following steps will show you how to use the TEXTJOIN function, once again using the comma and space combination to create your first merged cell:

  1. 1. Double-click the cell in which you want to put the combined data
  2. 2. Type =TEXTJOIN to insert the function
  3. 3. Type “, ”,TRUE, followed by the references of the cells you want to combine, separating each reference with a comma (the role of TRUE is to disregard empty cells you may have input)
  4. 4. Press Enter

How to Combine Multiple Excel Columns Into One Screenshot 5

In order to create the rest of your combined column, use the drag-and-drop steps listed below:

  1. 1. Hover your mouse over the bottom-right corner of the merged cell you just created
  2. 2. When the cursor changes into a + symbol, drag your cursor as far down the column as you want and release it.

How to Combine Multiple Excel Columns Into One Screenshot 6

Now your columns of data have successfully merged into your new column.

The Beginner’s Guide to Excel Version Control

Discover what Excel version control is, the version control features Excel has to offer, and how to use them to share, merge, and review Excel changes

READ MORE

The Beginners Guide to Excel Version Control

Use the INDEX formula to stack multiple columns into one column in Excel

Let’s say you want to create a stack of data from your multiple columns, rather than create a single cell. You can easily do this across multiple cells and columns within your spreadsheet using the INDEX formula:

  1. 1. Select all of the cells containing your data
  2. 2. Type in a name for this group of data in the “Name Box” (box located to the left side of the formula bar). In this example, I’ve named the data “_my_data”
  3. 3. Select an empty cell in your Excel sheet where you want your stacked data to be located. Input the following INDEX formula (remember to substitute with your data name):
=INDEX(_my_data,1+INT((ROW(A1)-1)/COLUMNS(_my_data)),MOD(ROW(A1)-1+COLUMNS(_my_data),COLUMNS(_my_data))+1)
  1. 4. The first value from your data range should appear. Hover over the cell until the cursor changes into a + symbol, and drag your cursor as far down until you receive a #REF! value (this signals the end of your data set)

How to Combine Multiple Excel Columns Into One Screenshot 7

Other ways to combine multiple columns in Excel: Notepad and VBA script

There are two other ways you can combine multiple columns in Excel. These are often more time-consuming, and use other tools as part of the process. However, they may be more helpful for users who wish to avoid using Excel formulae.

Use Notepad to merge multiple columns in Excel

You can use Notepad to extract, format, and replace your data from multiple columns in your Excel. For this, you need to copy and paste each column from your Excel sheet into a Notepad file. Then, use the Replace function to add commas between each value. Once finished, you can copy and paste your formatted data back into your Excel.

Use VBA script to combine two or more columns in Excel

As an alternative to the INDEX function stacking method, you can use VBA script. Simply right-click and select “View code” within your Excel, and copy and paste the code in a new window. Press “F5” to run the code and create a Macro. You can then apply this to your Excel by selecting your data range and applying it to your destination column.

Want to Boost Your Team’s Productivity and Efficiency?

Transform the way your team collaborates with Confluence, a remote-friendly workspace designed to bring knowledge and collaboration together. Say goodbye to scattered information and disjointed communication, and embrace a platform that empowers your team to accomplish more, together.

Key Features and Benefits:

  • Centralized Knowledge: Access your team’s collective wisdom with ease.
  • Collaborative Workspace: Foster engagement with flexible project tools.
  • Seamless Communication: Connect your entire organization effortlessly.
  • Preserve Ideas: Capture insights without losing them in chats or notifications.
  • Comprehensive Platform: Manage all content in one organized location.
  • Open Teamwork: Empower employees to contribute, share, and grow.
  • Superior Integrations: Sync with tools like Slack, Jira, Trello, and more.

Limited-Time Offer: Sign up for Confluence today and claim your forever-free plan, revolutionizing your team’s collaboration experience.

Conclusion

As you can see, combining multiple columns is easy in Excel. Whether you’re combing multiple Excel files, or columns and cells, there are a variety of ways that cater to different users, depending on their technical abilities or needs.

As a result, not only can you format your Excel into a cohesive and seamless spreadsheet, but also save time and optimize your productivity when evaluating, managing, or sharing important data. Once you know how to combine multiple columns in Excel into one column, combining or merging your data can become one quick and simple task.

This post will guide you how to transpose multiple columns into a single columns with multiple rows in Excel. How do I put data from multiple columns into one column with Excel formula; How to transpose columns into single column with VBA macro in excel.

Assuming that you have a data list in range B1:D4 contain 3 columns and you want to transpose them into a single column F. just following the below two ways.

Table of Contents

  • Transpose Multiple Columns into One Column with Formula
  • Transpose Multiple Columns into One Column with VBA Macro
    • Related Functions

You can use the following excel formula to transpose multiple columns that contain a range of data into a single column F:

#1 type the following formula in the formula box of cell F1, then press enter key.

=INDEX($B$1:$D$4,1+INT((ROW(B1)-1)/COLUMNS($B$1:$D$4)),MOD(ROW(B1)-1+COLUMNS($B$1:$D$4),COLUMNS($B$1:$D4))+1)

transpose multiple columns11

#2 select cell F1, then drag the Auto Fill Handler over other cells until all values in range B1:D4 are displayed.

#3 you will see that all the data in range B1:D4 has been transposed into single column F.

transpose multiple columns1

Transpose Multiple Columns into One Column with VBA Macro

You can also write an Excel VBA Macro to transpose the data of range in B1:D4 into single column F quickly. Just do the following steps:

#1 click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

#2 then the “Visual Basic Editor” window will appear.

#3 click “Insert” ->”Module” to create a new module.

convert column number to letter3

#4 paste the below VBA code into the code window. Then clicking “Save” button.

transpose multiple columns2

Sub transposeColumns()
    Dim R1 As Range
    Dim R2 As Range
    Dim R3 As Range
    Dim RowN As Integer
    wTitle = "transpose multiple Columns"
    Set R1 = Application.Selection
    Set R1 = Application.InputBox("please select the Source data of Ranges:", wTitle, R1.Address, Type:=8)
    Set R2 = Application.InputBox("Select one destination single Cell or column:", wTitle, Type:=8)
    RowN = 0
    Application.ScreenUpdating = False
    For Each R3 In R1.Rows
        R3.Copy
        R2.Offset(RowN, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
        RowN = RowN + R3.Columns.Count
    Next
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub

#5 back to the current worksheet, then run the above excel macro. Click Run button.

transpose multiple columns3

#6 select the source data of ranges, such as: B1:D4

transpose multiple columns4

#7 select one single cell in the destination Column, such as: F1

transpose multiple columns5

#8 let’s see the last result.

transpose multiple columns6


  • Excel INDEX function
    The Excel INDEX function returns a value from a table based on the index (row number and column number)The INDEX function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the INDEX function is as below:= INDEX (array, row_num,[column_num])…
  • Excel INT function
    The Excel INT function returns the integer portion of a given number. And it will rounds a given number down to the nearest integer.  And the INT function rounds down, so if you provide a negative number, the returned value will become more negative.The syntax of the INT function is as below:= INT (number)…
  • Excel ROW function
    The Excel ROW function returns the row number of a cell reference.The ROW function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the ROW function is as below:= ROW ([reference])….
  • Excel Columns function
    The Excel COLUMNS function returns the number of columns in an Array or a reference.The syntax of the COLUMNS function is as below:=COLUMNS (array)….
  • Excel MOD function
    he Excel MOD function returns the remainder of two numbers after division. So you can use the MOD function to get the remainder after a number is divided by a divisor in Excel. The syntax of the MOD function is as below:=MOD (number, divisor)….

I have multiple lists that are in separate columns in excel. What I need to do is combine these columns of data into one big column. I do not care if there are duplicate entries, however I want it to skip row 1 of each column.

Also what about if ROW1 has headers from January to December, and the length of the columns are different and needs to be combine into one big column?

ROW1| 1   2   3    
ROW2| A   D   G    
ROW3| B   E   H    
ROW4| C   F   I

should combine into

A    
B    
C    
D    
E    
F    
G    
H    
I

The first row of each column needs to be skipped.

Community's user avatar

asked Jun 4, 2010 at 20:40

Akib's user avatar

Try this. Click anywhere in your range of data and then use this macro:

Sub CombineColumns()
Dim rng As Range
Dim iCol As Integer
Dim lastCell As Integer

Set rng = ActiveCell.CurrentRegion
lastCell = rng.Columns(1).Rows.Count + 1

For iCol = 2 To rng.Columns.Count
    Range(Cells(1, iCol), Cells(rng.Columns(iCol).Rows.Count, iCol)).Cut
    ActiveSheet.Paste Destination:=Cells(lastCell, 1)
    lastCell = lastCell + rng.Columns(iCol).Rows.Count
Next iCol
End Sub

answered Jun 5, 2010 at 13:15

Alex P's user avatar

Alex PAlex P

12.2k5 gold badges51 silver badges69 bronze badges

3

You can combine the columns without using macros. Type the following function in the formula bar:

=IF(ROW()<=COUNTA(A:A),INDEX(A:A,ROW()),IF(ROW()<=COUNTA(A:B),INDEX(B:B,ROW()-COUNTA(A:A)),IF(ROW()>COUNTA(A:C),"",INDEX(C:C,ROW()-COUNTA(A:B)))))

The statement uses 3 IF functions, because it needs to combine 3 columns:

  • For column A, the function compares the row number of a cell with the total number of cells in A column that are not empty. If the result is true, the function returns the value of the cell from column A that is at row(). If the result is false, the function moves on to the next IF statement.
  • For column B, the function compares the row number of a cell with the total number of cells in A:B range that are not empty. If the result is true, the function returns the value of the first cell that is not empty in column B. If false, the function moves on to the next IF statement.
  • For column C, the function compares the row number of a cell with the total number of cells in A:C range that are not empty. If the result is true, the function returns a blank cell and doesn’t do any more calculation. If false, the function returns the value of the first cell that is not empty in column C.

TylerH's user avatar

TylerH

20.6k64 gold badges76 silver badges97 bronze badges

answered Dec 3, 2014 at 8:25

CristinaP's user avatar

CristinaPCristinaP

3063 silver badges6 bronze badges

0

Not sure if this completely helps, but I had an issue where I needed a «smart» merge. I had two columns, A & B. I wanted to move B over only if A was blank. See below. It is based on a selection Range, which you could use to offset the first row, perhaps.

Private Sub MergeProjectNameColumns()
    Dim rngRowCount As Integer
    Dim i As Integer

    'Loop through column C and simply copy the text over to B if it is not blank
    rngRowCount = Range(dataRange).Rows.Count
    ActiveCell.Offset(0, 0).Select
    ActiveCell.Offset(0, 2).Select
    For i = 1 To rngRowCount
        If (Len(RTrim(ActiveCell.Value)) > 0) Then
            Dim currentValue As String
            currentValue = ActiveCell.Value
            ActiveCell.Offset(0, -1) = currentValue
        End If
        ActiveCell.Offset(1, 0).Select
    Next i

    'Now delete the unused column
    Columns("C").Select

    selection.Delete Shift:=xlToLeft
End Sub

answered Jun 4, 2010 at 20:49

Steven Dorfmeister's user avatar

Function Concat(myRange As Range, Optional myDelimiter As String) As String 
  Dim r As Range 
  Application.Volatile 
  For Each r In myRange 
    If Len(r.Text) Then 
      Concat = Concat & IIf(Concat <> "", myDelimiter, "") & r.Text 
    End If 
  Next 
End Function

answered Jun 4, 2010 at 21:01

Mark Baker's user avatar

Mark BakerMark Baker

208k31 gold badges340 silver badges383 bronze badges

Copy table to one column in Excel
Copy table to one column

Say, you have an Excel table and want to copy all column underneath each other so that you only have one column. For example, you have a table 2 rows by 4 columns like in the screenshot on the right-hand side. You want to copy and paste this table to one column. You often need such transformation for inserting PivotTables or to create database formats. This article provides 4 simple methods to transform a 2-dimensional table into one column in Excel.

Example

"<yoastmark

The following methods will be introduced with a simplified example as shown on the right-hand side. You have a table with numbers within the cell range A1 to G7. That means you have 7 rows and also 7 columns. In total 49 cells to be copied to one column.

Method 1: Copy table to one column manually

Copying and pasting a table to one column manually might be the fastest method.
Copying and pasting a table to one column manually might be the fastest method.

Like so often, copying and pasting the columns manually might be the fastest solution. Given that you are reading this article, this might not be the method you want to hear. But anyway, doing it manually is often the fastest way.

Maybe some advice to speed up the manual process might help. Try to use as many keyboard shortcuts as possible. That way you could save some time.

  • Holding Ctrl and pressing one of the arrow keys makes you jump between tables and cells.
  • Holding the Shift key, you can select cells and ranges.
  • And – of course – with Ctrl + C and Ctrl + V you can copy and paste cells.

For more information about the keyboard shortcuts please refer to our big keyboard shortcut package.

Method 2: The INDEX formula

You can convert a two-dimensional table into just one column by using the INDEX formula. Unfortunately, it requires some preparations. But on the other hand, it’s one of the faster ways (compared to setting up the more complex OFFSET formula like in method 3 below or the INDIRECT formula).

Let’s see what you need to prepare. Basically you have to create the column and row number in additional helper columns. That way you can easily refer to the original table. The screenshot on the right-hand side shows the necessary preparations.

  • You need one column containing the row number (here in column A). You always start with 1. So if you data start in row 3, the first number you write is still 1.
  • You need one column containing the column number (here in column B). Also for the column number you always start with number one.
  • The third column contains the actual values, pulled by the formula =INDEX($A$1:$G$7;A10;B10)  . Example: In cell C10, the INDEX formula returns the value from the first row and first column of the range A1 to G7.

Please refer to this article for more information about the INDEX formula in Excel.

Method 3: OFFSET formula

The third method uses the OFFSET formula for copying several columns underneath each other to one column. If you need some introduction to the OFFSET formula, please refer to this article.

For using the universal OFFSET formula you have to identify 3 important cells.
For using the universal OFFSET formula you have to identify 3 important cells.

Because the formula is – in this universal case – very long, we don’t go much into detail here. It’s based on three cells.

  1. The top left cell of the table you want to convert (here: A1).
  2. The bottom left cell of the table you want to convert (here: A7).
  3. The heading cell of your single column, which is supposed to contain all the data from the table (here: A9)

Now you just have to replace the cell links in the following formula with your cells. Don’t forget to fix the references with the $-signs as shown in the formula below.

=OFFSET($A$1,(ROW()-ROW($A$9)-1)-(ROW($A$7)-ROW($A$1)+1)*ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0),ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0))
Name the three important cells as shown in the image.
Name the three important cells as shown in the image.

In order to make it easier for you to use the formula, you can use the version below. All you have to do is to give names to the three main cell as shown in the image on the right-hand side. In order to achieve this, select the top left cell of your original table (here: A1) and click into the name field. Type “TopLeftCell” and press Enter on the keyboard. Repeat this with the bottom left cell (name “BottomLeftCell”) as well as the heading cell of your new table (name “HeadingCell”).

Once done, copy and paste the following formula it the first cell (here: A10). Now just copy and paste this cell down until all columns from your original table are covered.

=OFFSET(TopLeftCell,(ROW()-ROW(HeadingCell)-1)-(ROW(BottomLeftCell)-ROW(TopLeftCell)+1)*ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0),ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0))

Method 4: Professor Excel Tools

You want to use the most convenient way? Try the Excel add-in “Professor Excel Tools”. The steps are shown in the screenshot below.

The Excel add-in "Professor Excel Tools" provides a convenient way to copy a table into a single column.
The Excel add-in “Professor Excel Tools” provides a convenient way to copy a table into a single column.
  1. Select the table you want to transform into a single column.
  2. Click on Copy on the left-hand side of the “Professor Excel”-ribbon.
  3. Select the first cell from which Professor Excel should paste the columns underneath.
  4. Click on “Paste to Single Column” on the “Professor Excel” ribbon.
  5. Now you can finetune the copy-and-paste-format. Do you which to copy the formulas without changing cell references, do you which to copy them as values or do you want to insert links to the original table? Then press Start.

That’s it. Do you want to try “Professor Excel” for free? Then just follow this link for more information or start the download right away.


Professor Excel Tools Box

This function is included in our Excel Add-In ‘Professor Excel Tools’

(No sign-up, download starts directly)


Download

download, arrow Please feel free to download all examples shown above in one comprehensive Excel file. Just click on this link and the download starts right away.

Very often we need to combine several columns into one when using Microsoft Excel. A powerful feature called “merge & center” enables us to merge two cells together. “Merge across” enables us to merge range across different rows. However, there isn’t any feature nor function that stack multiple columns into one column.

If you have the following questions, I suggest you reading this until the end.

  • How to delete hidden rows in Excel?
  • How to delete invisible rows in Excel?
  • How to delete hidden rows from entire Excel workbook?

In this article, I will show you how to stack multiple columns into one column. I will show you how to stack multiple column into a single vertical column from up to down and from left to right.

You might also be interested in Excel Split Long Text into Short Cell Without Splitting Word.

Stack Multiple Columns into One Column vertically (Up to down)

Here is an example to show you how to stack Multiple Columns into One Column vertically.

What we would like to do

To stack multiple columns into one column, from top to bottom and then from left to right

You might also be interested in How to prevent duplicate entries in Excel?

Step 1: Enter this formula right below the end of the first column

Formula

=the_first_cell_of_the_second_column

In the example, the first column ends at cell A5. So, I input the formula into cell A6.

It is such a neat formula, right?

I have seen people done this with a much complicated formula.

I would say

You may wonder why cell B2 instead of cell B1 is put here.

This is because I don’t want to include row 1 in my final results. If that is what you want, you can input B1 instead of B2.

Let me show you how the end result would look like if I have put B1 instead.

Step 2: Hover on the lower right corner of the cell and drag it until the last column

When you put your mouse pointer over the lower right edge of the cell, you will see a small black plus sign.

Click the black plus sign and drag it over to the last column (column D in this case) and don’t release your finger until you reach the last column.

This feature is called Autofill. It automatically fills in a series of cells for you.

When you do this, make sure you have selected the cell. Otherwise the small black plus sign won’t appear.

The table should look like this when you release the left mouse button.

Step 3: Hover on the lower right corner of the cell and drag it until the last row

Step 3 is very similar to step 2.

Once again, we will need to make use of the Autofill feature in Excel.

The only thing that is different is that this time we are going to drag the small plus sign downwards.

In the previous step, we dragged the small plus sign rightwards until the last columns.

This time, we will need to drag the sign downwards until the last row.

You may wonder which row to drag until.

Usually, I just follow my heart. I will drag this down randomly and stop at a point where I think is right.

If I dragged more than I need, the extra rows will contain a “0”. I just delete them.

If you drag too much, you don’t need to worry for now. We will fix that later.

The table should look like this when you release the left mouse button.

Step 4: Copy and paste values

Step 5: “Home” > “Find & Select” > “Replace”

Step 6: Input “0” in “Find what” field > empty the “Replace with” field > Press “Replace All”

Here we will replace all “0” with nothing.

Make sure the “Replace with” field is empty. Not even space is allowed.

After pressing “Replace All”, you will see a pop up window telling you how many replacements have been made.

Then you can close the replace window by pressing Esc key.

The table should look like this now. All we have to do is to delete the extra data.

In this case, cell B6 to cell B17 and cell C6 to C9 are redundant.

Step 7: Select the redundant cells and click the right mouse button > Press “Delete” > Press “OK”

Result

You might also be interested in 6 Ways To Converting Text To Number Quickly In Excel

Stack Multiple Columns into One Column by formula (left to right)

All we need is a formula.

Formula in Cell F1

=INDEX($A$2:$D$5,1+INT((ROW(A1)-1)/COLUMNS($A$2:$D$5)),MOD(ROW(A1)-1+COLUMNS($A$2:$D$5),COLUMNS($A$2:$D$5))+1)

How to use the formula

=INDEX(Original_table,1+INT((ROW(A1)-1)/COLUMNS(Original_table)),MOD(ROW(A1)-1+COLUMNS(Original_table),COLUMNS(Original_table))+1)

In the above example, the table starts from cell A2 and stop at cell D5. So we will put A2:D5 as the Cell_range. Make sure you lock the cell (Add dollar sign to each cell). The shortcut to lock cells is to press F4.

We are almost there.

Just make sure you got the formula in the first cell right. Then you can copy the cell down until you saw a #REF error.

# REF error

The formula may seem a bit complicated at the first glance but it is not.

It doesn’t require much effort to edit the formula.

Stack Multiple Columns into One Column by VBA (left to right)

**Read How to Insert & Run VBA code in Excel – VBA101 if you forget how to insert VBA code in Excel.

Sub StackColumnIntoOne()
    Dim Tablerng, Destinationrng, Rng As Range
    
    'Get table range by inputbox
    Set Tablerng = Application.InputBox(Prompt:="Please select the table range", Type:=8)
    'Get destination range by inputbox
    Set Destinationrng = Application.InputBox(Prompt:="Please select the Destination cell", Type:=8)
    
    For Each Rng In Tablerng.Rows
            'Copy each cell inside the table
            Rng.Copy
            'Paste them into the destination column
            Destinationrng.Offset(RowIndex, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
            RowIndex = RowIndex + Rng.Columns.Count
    Next
    
End Sub

What this VBA code does

This VBA code does the exact same thing as the How to Check/Test if Sheets Exist in Excel?

How To List All Worksheets Name In A Workbook

How to Unpivot or Reverse Pivot in Excel

You might also be interested in How To Remove Digits After Decimal In Excel?

Hungry for more useful Excel tips like this? Subscribe to our newsletter to make sure you won’t miss out on any of our posts and get exclusive Excel tips!

Понравилась статья? Поделить с друзьями:
  • Columns in word documents
  • Columns in excel not showing
  • Columns in excel are hidden
  • Columns functions in excel
  • Columns function in excel