merged cells

C

Casc

I want to check the property of a cell to see if it is
merged. Does anybody know how to write the code for this?

Thanks
Casc
 
T

Tom Ogilvy

Sub aa_tester6()
Dim rng As Range
Set rng = Range("A1")
If rng.MergeCells Then
MsgBox rng.Address & " is in the merged area " _
& rng.MergeArea.Address
Else
MsgBox rng.Address & " is not in a merged area"
End If
End Sub
 

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