Use the Merge Cells add-in. A quick and formula-free way to concatenate any range in Excel is to use the Merge Cells add-in for Excel with the 'Merge all areas in selection' option turned off, as demonstrated in Combine the values of several cells into one cell. Concatenate numbers and dates in various formats. Open the Excel spreadsheet that contain the columns you might need to merge as shown below: In this example the first name and the last name has to be merged in the Full Name column. In the C2 cell type =CONCATENATE (A2, ” ”,B2). Here A2 is Vinod and B2 is Mvd. Click the first cell containing data to be combined. Type &' '& in the new cell after the cell identifier (i.e., A2, B2, C2, etc.). Make sure you have a space between the two quotation marks, to allow for a space between the data being combined. Click the second cell containing data to be combined. Press the Enter key to combine the data in the. Steps to follow to use VBA to Merge Cells: First, you need to define the range of cells that you want to merge. After that, type a (.) dot to get the list of properties and methods and select “Merge” from that list or you can type. After that, you need to define the argument “Across” as TRUE. Combine data with the Ampersand symbol (&) Select the cell where you want to put the combined data. Type = and select the first cell you want to combine. Type & and use quotation marks with a space enclosed. Select the next cell you want to combine and press enter. An example formula might be =A2&'.
Merging cells in a spreadsheet means taking two or more cells and constructing a single cell out of them. Fgo discord. Merging is generally used as a cosmetic trick to center a title over a particular section in a spreadsheet.
The below image clearly shows how a merged cell looks like.
In this post, we will see different ways to merge cells in Excel. But before that let’s understand what makes merging different from concatenation.
How Merging is different from Concatenation?
Merge Two Cells In Excel With Comma
Many times people confuse between these two words. As I have foretold, Merging is the process of taking two or more cells and constructing a single cell out of them. On the other hand, Concatenation is the process of joining or combining the values from two or more cells.
Recommended Reading: Concatenate Cells in Excel
There are different methods to merge cells in Excel. In the below section we will understand how to do this:
Method 1: Merging multiple cells using the Merge and Centre button in Ribbon
In this method, we will see how to merge cells in excel using the Merge and Centre Button in Excel. Follow the below steps to do this:
- First of all, select the cells that you wish to merge.
- After this navigate to the “Home” tab in the top ribbon and click the “Merge & Centre” button as shown in the below image.
- This will merge all the selected cells and the output will look like the below image.
Method 2: Merging multiple cells using the Format Cells option
In this method, we are going to utilize the Format Cells option to merge the selected cells.
- First of all similar to the previous method, select the cells that you have to merge.
- Next, click the “More Options” button near the “Alignment Settings” on the “Home” Tab as shown.
Alternatively, you can also right-click the selected range and click the “Format Settings” option from the right-click menu.
Tip: You can also use the shortcut Alt + H F A for performing this.
- After this “Format Cells” window will open. Now, in the “Format Cells” window navigate to the “Alignment” tab and check the “Merge” checkbox and click “Ok”.
- This will merge the selected cells.
Method 3: How to Merge cells in Excel using VBA Macro:
Excel Combine Contents Of Two Cells
If you wish to merge cells using a VBA program then you should try the below codes:
A. VBA Code to merge Selected sells:
This code merges the cells that are selected by the user. The code will only execute if the selected cells are greater than 1.
Recommended Reading: IF Statement, Message Box in VBA
A. VBA Code to merge Specified cells:
This code asks the user to enter a range, then it merges all the cells present in the specified range.
Recommended Reading: InputBox in VBA, Error Handling in VBA
Merge Cells Across
In the above methods, we have seen how easy it is to merge cells in Excel. But have you thought about how you can merge several individual rows in a range?
The below image will make our objective very clear.
If you select all the cells to be merged and then merge them using any of the methods, the output will be like this:
Option-1: One obvious solution to this would be selecting each row and then merging them individually. This solution will work but if you have a large number of columns then it can be quite cumbersome to merge every row individually.
Option-2: Using the “Merge Across” option. This is an easy way to accomplish our goal and that too in a split second.
Follow the below steps to know how to use this option:
- First of all, select the range that you wish to merge as several individual rows.
- Next, navigate to the “Home” Tab in Ribbon and click the dropdown arrow on the “Merge and centre” button. Now from the menu Click the option “Merge Across” as shown.
- This will merge the cells as several individual rows.
How to Merge without losing data
Do you know that merging can sometimes also result in data loss? Yes, you read that right.
See the below image to know how it happens.
So, what’s the Solution?
The solution to this can be a simple macro that can first concatenate the values in all the selected cells into the upper-leftmost cell and then merge them together.
This boils down to:
This code has been written by Chandoo, you read more ways to tackle this issue on his blog here.
Why Merging sometimes leads to issues:
Merging in excel can cause problems while sorting. If you try to sort your data containing some merged cells, Excel will throw an error saying that, “To do this, all merged cells should be of same size”.
So, I will suggest you minimize the use of Excel’s merging capability.
Recommended Reading: Find merged Cells in Excel
So, this was all from my side. Do let me know in case you come across any issues while trying to merge cells in Excel.