Cells are Merged. How to know where to where???

M

musa.biralo

Hi,
i have a merged cells say (a1 to b5). Now i am trying to know,

1) whether the cell is merged or not
2) if merged, where to where, from which cell to which cell

Your help will highly be appreciated.

Huge Thanks

musa.biralo
 
B

Bob Phillips

Dim cell As Range
Dim coll As Collection
Dim collItem


Set coll = New Collection
For Each cell In Range("A1:B5")
On Error Resume Next
If cell.MergeCells Then
coll.Add cell.MergeArea.Address(False, False), _
cell.MergeArea.Address(False, False)
End If
On Error GoTo 0
Next cell

For Each collItem In coll
MsgBox collItem
Next collItem


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
M

musa.biralo

Hey Bob,

Thank so much...this is more than what i was expecting....Great Help.

Thanks again
musa.biralo
 

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