Merged Cells in Worksheet, Test for

  • Thread starter Thread starter EagleOne
  • Start date Start date
E

EagleOne

XL 2003

Simple way to test for existence of any merged cells in worksheet.

Must it be a cell by cell evaluation OR [Each myCell in myRange]
is there a "merged state" that is reflected on a Sheet basis?
[ i.e. like Activesheet.UsedRange.MergeCells]

EagleOne
 
Re: Merged Cells in Worksheet, Test for

Ultimately I found a way to determine, on a Sheet-level basis if there
are merged cells on the sheet somewhere (without having to examine each
cell in the used range). This is important, because it saves time on
very large worksheets.

NOTE: this works in XL 2003, not sure for older versions.

Sub SheetLevelTestForMergedCells()

If Cells.MergeCells = False Then
MsgBox "No Merged Cells on this Sheet!"
Else
MsgBox "Merged Cells Found!"
End If

End Sub

For some reason, neither

Cells.MergeCells = True

nor

Cells.MergeCells = Null

works in the reverse. BTW, if someone finds inconsistencies please
post back.
 

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

Back
Top