Skip to main content

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.

doc select merged cells 4

Identify and select all merged cells with Find command

Quickly select and count all merged cells with Kutools for Excel

Identify all merged cells with VBA code


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:

doc select merged cells 1

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.

doc select merged cells 2

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:

doc select merged cells 3

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:

doc select merged cells 7

Tip: To use this feature, you should install Kutools for Excel first, please click to download and have a 30-day free trial now.

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:

doc select merged cells 4

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 InsertModule, 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:

doc select merged cells 5