How to identify and select all merged cells in Excel?
Do you know how to find and select all merged cells in Excel? Here are three cool tricky ways to identify and select all merged cells in a selection or range in Excel quickly.
Identify and select all merged cells with Find command
Quickly select and count all merged cells with Kutools for Excel
Identify and select all merged cells with Find command
You can identify and select all merged cells in active worksheet by Find command with following steps:
1. Click the Home > Find & Select > Find to open the Find and Replace dialog box. You can also open the Find and Replace dialog box with pressing the Ctrl + F keys.
2. Click the Format button in the dialog box, (If you can't find out the Format button, please click the Options button to expand the dialog.) see screenshot:
3. In the popping up Find Format dialog box, only check the Merge Cells option in the Text control section under Alignment tab, and click OK.
4. Now you go back to the Find and Replace dialog box, click Find All button. All merged cells are listed at the bottom of this dialog box. Select all finding results with holding down the Shift key.
Now all merged cells in active sheet are selected when you select all finding results. See screenshot:
Tips: If you want to only identify, find, and select merged cells in a selection, you need to select the range first.
Select and count all merged cells with Kutools for Excel
Kutools for Excel's Select Merged Cells tool will help you identity, find and selected all merged cells in a selection with only one click.
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
After installing Kutools for Excel, please do as follows:( Free Download Kutools for Excel Now! )
1. Select the data range that you want to select the merged cells.
2. Click Kutools > Select > Select Merged Cells, see screenshot:
3. And all the merged cells in the selection have been selected at once, and the number of the merged cells are counted as well, see screenshot:
Identify all merged cells with VBA code
VBA 1: Identify and highlight all merged cells
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
Sub FindMergedcells()
'updateby Extendoffice
Dim x As Range
For Each x In ActiveSheet.UsedRange
If x.MergeCells Then
x.Interior.ColorIndex = 8
End If
Next
End Sub
3. Press the F5 key to run this macro. All merged cells in active worksheet are identified and highlighted, see screenshot:
VBA 2: Identify and list all merged cells
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
Sub ListMergedcells()
'updateby Extendoffice
Dim x As Range
Dim sMsg As String
sMsg = ""
For Each x In ActiveSheet.UsedRange
If x.MergeCells Then
If sMsg = "" Then
sMsg = "Merged cells:" & vbCr
End If
sMsg = sMsg & Replace(x.Address, "$", "") & vbCr
End If
Next
If sMsg = "" Then
sMsg = "No merged cells."
End If
MsgBox sMsg
End Sub
3. Press the F5 key to run this macro, all merged cells are listed in a popping up dialog box. See screenshot:
Related articles
How to allow merge cells within protected worksheet in Excel?
By default, a protected worksheet does not allow users to merge cells. However, you can merge cells within protected worksheet with VBA method as we provide in this article.
How to merge cells in a range formatted as table in Excel?
In Excel, you can easily merge some consecutive cells into one with the Merge & Center utility as below screenshot shown. However, it cannot merge the cells in a range which formatted as a table in Excel, is there any trick to handle it?
How to merge cells without centering the contents in Excel?
In Excel, when merging two or more cells in Excel, the Merge & Center function can help you. But in sometimes, how can you do if you just want to merge cells but do not center the contents as below screenshot shown? Here, in this tutorial, I introduce the methods on solving this job in Excel.
How to unmerge cells and fill with duplicate values in Excel?
If you have a worksheet which contains numerous merged cells, and now you need to unmerge them and auto-fill down the original values from the merged cells as following screenshots shown. How could you quickly deal with this task?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
