Merge & Center combine and center the contents of the selected cells in a new, larger cell. This is a great way to create a label that spans multiple criteria. This is used to combine multiple cells into a single cell and create the main headers for reports in Microsoft Excel.
So when you work dashboards, you get the need for Merge and Center cells. The traditional way is lengthy and there is no simple shortcut to merge and center, like CTRL+C for copying. But there are ways to workaround.
To merge and center two or more cells follow these steps:
This is not actually a shortcut to merge cells in excel but it is fast. The ALT key activates the ribbon and following keys take you to the Merge and Center option. H takes you to Home tab, M takes you to Merge and Center options and C selects the Merge and Center option.
As we can see text in B1 cell is now merged and centered in B1 to D1 cells.
Merge And Center Options
There are four options available in Merge and Center:-
We are going to focus on Merge and Centre here.
As I said, there is no specific shortcut for merge and center but you can create one using macros. It’s easy.
Selection.Merge 'to merge selected cells
Now you have a shortcut to merge cells. If you instead want to merge and center then add this line in macro
Selection.HorizontalAlignment = xlCenter
And if you want to the text to be in the center of the cell vertically too, add this line too.
Selection.VerticalAlignment = xlCenter
Finally, your code will look like this,
Sub mergeCells() ' mergeCells Macro Selection.HorizontalAlignment = xlCenter ' to align text horizontally in cent Selection.VerticalAlignment = xlCenter ' to align text vertically in center Selection.Merge ' to merge cells End Sub
Now, whenever you’ll press CTRL+j, all selected cells will be merged. And this how you get a shortcut to merge and center cells in excel.
|Note: Merge and Centre option takes the text of only one cell which will be upper-left most cell while performing Merge and center.|
You have to be careful about your content in the cells which is to be merged.
Example of Merge And Center in Excel
We need to merge cells B1 to D1. When we’ll use ALT>H>M>C excel shortcut to merge cells, excel will show a warning. This warning says that all cells will lose their data except upper-left cell if we merge and center these cells.
Click OK and output will be like as shown below.
Now the same function will be performed on E1 to G1 cell and H1 to J1 cells.
So we will use the F4 key to perform the last function again.
In the above image data of Team A is under Team A label. Similarly, for Team B and Team C, we can say the same.
Frequently Asked Questions
Q1. How to merge columns in Excel?
Ans: Simple, select the columns and press keys ALT>H>M>C sequentially. Done. Next.
Q2. How to unmerge cells in excel?
Again same, select merged cells and press keys ALT>H>M>C sequentially. Done. Next.
Q3. How to merge cells in word?
Well, this is an Excel tutorial but still, select the cell in word and press ALT>J>L>M.
Please find more articles on Labeling and highlighting cells here. Hope you got this by now. Please share your queries in the comment box below. We will solve it for you.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.