View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Merged Cells: Any way to backtrack?

Why not just

Sub AAA()
Debug.print Range("A3").MergeArea.Address
End Sub


Absolutely no reason whatsoever. That is definitely a better option.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)

"Tom Ogilvy" wrote in message
...
Chip,

Why not just

Sub AAA()
Debug.print Range("A3").MergeArea.Address
End Sub

Just curious.

--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
Pete,

You could try something like the following:

Sub AAA()
Dim MergeCell As Range
Dim OrigCells As Range
Set MergeCell = Range("A3")
With MergeCell.MergeArea
Set OrigCells = .Resize(.Rows.Count, .Columns.Count)
End With
Debug.Print OrigCells.Address
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)

"(PeteCresswell)" wrote in message
...
If somebody sends me a worksheet that contains merged cells, Is there
any way
for me to programmatically determine what the original component cells
were?
--
PeteCresswell