如何找到Excel中的单元格是否合并?如果单元格如何读取值? [英] How to get find if a cell in excel is merged? If the cell mrged how to read the value?

查看:741
本文介绍了如何找到Excel中的单元格是否合并?如果单元格如何读取值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测excel中的单元格是否合并?

How do I detect if a cell in excel is merged?

如果单元格合并,如何读取值?

If the cell is merged how do I read the value?

推荐答案

我不认为有没有公式告诉你一个单元格是否被合并。您可以撰写自己公开的 vba 功能的问题,放在在代码模块中,然后在您的工作表上使用它:

I don't think there's any formula to tell you if a cell is merged or not. You can write your own public vba function, put it in a code Module, and then use that on your sheet:

Function IsMerged(rCell As Range) As Boolean
' Returns true if referenced cell is Merged        
          IsMerged = rCell.MergeCells        
End Function

然后作为Excel公式测试单元格 A1

Then as an Excel formula to test cell A1:

=IsMerged(A1)

这篇关于如何找到Excel中的单元格是否合并?如果单元格如何读取值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆