C#怎么判断Excel单元格合并的情况
1个回答
2016-07-22
展开全部
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询