Function CountAllCell(rng As Range) As Long
Dim mergedArea As Range
Dim mergedCellCount As Long
Dim independentCellCount As Long
Dim cell As Range
mergedCellCount = 0
independentCellCount = 0
' 遍历用户指定的范围
For Each cell In rng
If cell.MergeCells Then
' 如果该单元格是合并单元格的一部分
' 使用 MergeArea 属性获取合并单元格区域
Set mergedArea = cell.MergeArea
创作者俱乐部成员
WPS寻令官 | WPS产品体验官
创作者俱乐部成员