Note: The other languages of the website are Google-translated. Back to English
登陆  \/ 
x
or
x
点此注册  \/ 
x

or

如何在Excel中识别并选择所有合并的单元格?

您知道如何在Excel中查找和选择所有合并的单元格吗? 这是快速识别和选择Microsoft Excel 2007和2010中选定范围内的所有合并单元格的巧妙方法。

使用“查找”命令识别并选择所有合并的单元格

用VBA代码识别所有合并的单元格

使用Kutools for Excel选择并计算所有合并的单元格


箭头蓝色右气泡使用“查找”命令识别并选择所有合并的单元格

您可以通过以下方式识别并选择活动工作表中的所有合并单元格: 查找 命令,包括以下步骤:

1。 点击 主页 > 查找和选择 > 查找 打开 查找和替换 对话框。 您也可以打开 查找和替换 对话框,按 Ctrl + F 键。

2。 点击 格式 对话框中的按钮,(如果找不到 格式 按钮,请点击 选项 按钮以展开对话框。)请参见屏幕截图:

doc选择合并的单元格1

3。 在弹出 查找格式 对话框中,仅选中 合并单元格 在选项 文字控制 根据第 对准 选项卡,然后单击 OK.

doc选择合并的单元格2

4。 现在您回到 查找和替换 对话框,单击 找到所有 按钮。 所有合并的单元格都在此对话框的底部列出。 按住并选择所有查找结果 转移 键。

现在,当您选择所有查找结果时,将选中活动工作表中的所有合并单元格。 看截图:

doc选择合并的单元格3

提示: 如果您只想识别,查找并选择所选内容中的合并单元格,则需要首先选择范围。


箭头蓝色右气泡用VBA代码识别所有合并的单元格

VBA 1:识别并突出显示所有合并的单元格

1。 按住 ALT + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

2。 点击 插页 > 模块,然后将以下宏粘贴到 模块 窗口。

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。 按 F5 运行此宏的键。 标识并突出显示活动工作表中的所有合并单元格,请参见屏幕截图:

doc选择合并的单元格4

VBA 2:识别并列出所有合并的单元格

1。 按住 ALT + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

2。 点击 插页模块,然后将以下宏粘贴到 模块 窗口。

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。 按 F5 键以运行此宏,所有合并的单元格都在弹出对话框中列出。 看截图:

doc选择合并的单元格5


箭头蓝色右气泡 使用Kutools for Excel选择并计算所有合并的单元格

Kutools for Excel's 选择合并的单元格 该工具将帮助您一键确定,找到并选择所有合并单元格。

Kutools for Excel : 带有300多个便捷的Excel加载项,可以在30天内免费试用. 

安装后 Kutools for Excel,请执行以下操作: 立即免费下载Kutools for Excel! )

1。 选择您要选择合并的单元格的数据范围。

2。 点击 Kutools > 选择 > 选择合并的单元格,请参见屏幕截图:

3。 并且一次选择了所有合并的单元格,并且合并的单元格数也被计数,请参见屏幕截图:

doc选择合并的单元格7

立即免费下载Kutools for Excel!


最佳办公效率工具

Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

  • 重用: 快速插入 复杂的公式,图表 以及您以前使用过的任何东西; 加密单元 带密码 创建邮件列表 并发送电子邮件...
  • 超级公式栏 (轻松编辑多行文本和公式); 阅读版式 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不会丢失数据; 拆分单元格内容; 合并重复的行/列...防止细胞重复; 比较范围...
  • 选择重复或唯一 行; 选择空白行 (所有单元格都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择...
  • 确切的副本 多个单元格,无需更改公式参考; 自动创建参考 到多张纸; 插入项目符号,复选框等...
  • 提取文字,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级滤镜 (将过滤方案保存并应用于其他工作表); 高级排序 按月/周/日,频率及更多; 特殊过滤器 用粗体,斜体...
  • 结合工作簿和工作表; 根据关键列合并表; 将数据分割成多个工作表; 批量转换xls,xlsx和PDF...
  • 超过300种强大功能。 支持Office / Excel 2007-2019和365。支持所有语言。 在您的企业或组织中轻松部署。 完整功能30天免费试用。 60天退款保证。
kte选项卡201905

Office选项卡为Office带来了选项卡式界面,使您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Say something here...
symbols left.
You are guest
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 · 6 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 · 6 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 · 6 years ago
    well done You are a star...
    Thanks :-)
  • To post as a guest, your comment is unpublished.
    srinivasan · 6 years ago
    Very Nice thanks a lot
  • To post as a guest, your comment is unpublished.
    JEAN · 6 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.
  • To post as a guest, your comment is unpublished.
    Chamundi · 6 years ago
    Probably obvious, but: In my last comment I should have made it clear you need to "select" each column, in turn, before scanning visually. Though really you only need to scan certain columns, I think: To the best of my knowledge, it's only cells containing text that will occasionally annex an adjoining cell, and numeric-only columns can be trusted not to do so.

    Even with text columns, you should be OK just checking every other column, because if any cell in the selected column has been involved in an annexation (to the right or from the left), that will show up in a visual scan of the selected column.

    I have never seen annexations occurring vertically, only horizontally. But if such a thing happened (a vertical annexation), you could try the same technique going row by row instead of column by column.

    The procedure is tedious, definitely. A royal pain, in fact. But if you have to sort your data, and Microsoft refuses to fix their bug, it's the only recourse I know of. Nowadays I try to remember to put a space character into each cell of the area I expect to use, prior to entering any other data, thus ensuring no annexations will occur.
  • To post as a guest, your comment is unpublished.
    pavithraravindar · 6 years ago
    thank u this help me to find merged cell in my excel
  • To post as a guest, your comment is unpublished.
    Chamundi · 7 years ago
    ... so in the spreadsheet you spoke of, which was not set up with those protective space characters, my approach would be to visually scan each column which lies just to the right of any text column; and immediately after identifying & unmerging each occurrence, I would put a space character in the empty cell so the merging will not recur.

    Probably there's a VBA or other coding means to accomplish this much more efficiently. Anyone???
  • To post as a guest, your comment is unpublished.
    Chamundi · 7 years ago
    Actually I think this can be avoided entirely, if you remember to do so before entering data into any text column.

    In my experience the only time cells are clandestinely merged is when an empty cell is to the right of a text cell, where normally the display of the text would be extended to take advantage of the otherwise unused display space provided by the empty cell.

    Therefore, when initially setting up your spreadsheet, before entering any data, you can fill every "susceptible" cell with a single space—as many rows down as you expect to have data to fill. That space will be honored like any other text, and the cell to the left will not annex it.
  • To post as a guest, your comment is unpublished.
    Chamundi · 7 years ago
    If your spreadsheet is small (or you are desperate enough), the best way I've found is to select one column at a time and scroll all the way down to the bottom. Any merged cells will be obvious, because the entire merged cell is highlighted. You can then fix each one, one by one.

    But you risk wasting a lot of time doing this, since Excel continues to merge cells "behind your back" whenever it feels like doing so.* Therefore, cells you have just unmerged (or others which hadn't been merged before) may become merged while you believe you are finishing the unmerging process.

    I tried to find a way to completely disable the merging of cells but haven't found it. Better, of course, would be some way to keep Excel from engaging in this psychopathic behavior!

    *Yesterday, desperate, I did try to unmerge cells in a not-so-large spreadsheet (22 columns and fewer than 1,000 rows). Each time I thought I had finished and tried to sort, I got that same message. So then I tried another way to identify where the merged cells were—selecting a screenful of rows at a time and trying the sort on just those rows. Each time I got the message, I would try half the screenful at a time (etc.) until I identified the row(s) with merged cells. By going through the entire spreadsheet until each screenful had been successfully sorted, I figured the entire sort should work. But, NOT. Excel had been gleefully merging cells I had just unmerged.

    Please, someone, post a solution!
  • To post as a guest, your comment is unpublished.
    Roy · 7 years ago
    This is an incredibly complex process that is way over my head for Excel. All I am looking to do is find out which cells are merged so I can do a sort. I received a message that said merged cells need to be the same size before I can sort and I don't know which ones are merged.
  • To post as a guest, your comment is unpublished.
    Chamundi Sabanathan · 7 years ago
    I have Excel 12.3.6 for Mac and it frequently takes it upon itself to merge cells. Then I cannot sort without identifying and unmerging each merged cell. In a large spreadsheet this is impractical. Should be able to use the "Merge" button in the Toolbox to unmerge all cells in a selected range, rather than just one at a time! Anyone else have this problem? or even better, a solution?