determine if sheet contains mergearea(s)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to determine if a sheet contains mergearea(s) without
checking individual cells for MergedCell?

tia,
dk
 
Sub test()
Dim bGotMergedCells As Boolean
Dim vMerged As Variant

vMerged = ActiveSheet.Cells.MergeCells
bGotMergedCells = IsNull(vMerged) Or vMerged

MsgBox bGotMergedCells
End Sub

Regards,
Peter T
 
If cells.MergeCells = Null then
' contains merged cells
elseif cell.MergeCells = True then
' whole sheet is one big merged cell
elseif cell.MergeCells = False
' no merged cells
End if
 
Back
Top