determine if sheet contains mergearea(s)

G

Guest

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

tia,
dk
 
P

Peter T

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top