ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   merged cells (https://www.excelbanter.com/excel-programming/277302-merged-cells.html)

Casc

merged cells
 
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

Tom Ogilvy

merged cells
 
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


--
Regards,
Tom Ogilvy




"Casc" wrote in message
...
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





All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com