怎么判断一个单元格是不是合并单元格
1个回答
展开全部
Sub dafd()
ss = Range("a1").MergeArea.Address(0, 0)
If Range("a1").MergeArea.Cells.Count > 1 Then
If Range("a1").MergeArea.Cells.Rows.Count = 1 Then
MsgBox "行合并"
ElseIf Range("a1").MergeArea.Columns.Count = 1 Then
MsgBox "列合并"
Else
MsgBox "多行多列合并"
End If
Else
MsgBox "非合并单元格"
End If
End Sub
ss = Range("a1").MergeArea.Address(0, 0)
If Range("a1").MergeArea.Cells.Count > 1 Then
If Range("a1").MergeArea.Cells.Rows.Count = 1 Then
MsgBox "行合并"
ElseIf Range("a1").MergeArea.Columns.Count = 1 Then
MsgBox "列合并"
Else
MsgBox "多行多列合并"
End If
Else
MsgBox "非合并单元格"
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询