Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to identify and select all merged cells in Excel?

Do you know how to find and select all merged cells in Excel? Here is the cool tricky ways to identify and select all merged cells in a selection or range in Microsoft Excel 2007 and 2010 quickly.

Identify and select all merged cells with Find command

Identify all merged cells with VBA code

Select and count all merged cells with Kutools for Excel


Select and count all merged cells in worksheet:

Kutools for Excel’s Select Merged Cells feature can help you to find and select all merged cells in a selection or a worksheet and get the number of merged cells as well.

doc select merged cells 8


arrow blue right bubbleIdentify 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.


arrow blue right bubbleIdentify 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 20160106
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 20160106
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


arrow blue right bubble 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 60 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:

doc select merged cells 6

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

Free Download Kutools for Excel Now!


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for you.

  • Designed for 1500+ work scenarios, helps you solve 80% Excel problems.
  • Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  • Being used by 110,000 elites and 300+ well-known companies.

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Natalia · 4 years ago
    Is it possible to identify the first and the last column number of the merged range in vba?
  • To post as a guest, your comment is unpublished.
    Ivor Shaer · 4 years ago
    I require code to list merged ranges in a worksheet where the merged ranges are individually entered in cells starting at "A1" thus

    a3:c3
    b2:b7
    etc...........
  • To post as a guest, your comment is unpublished.
    Senthooran · 4 years ago
    well done You are a star...
    Thanks :-)
  • To post as a guest, your comment is unpublished.
    srinivasan · 4 years ago
    Very Nice thanks a lot
  • To post as a guest, your comment is unpublished.
    JEAN · 5 years ago
    Actually I just about went mental trying to fix this in a spreadsheet. In desperation I selected all the cells (control A) clicked "merge and centre" and presto! it was fixed.