How can i decide whether a range of cells are merged or not?

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You can right click on the suspected area, then choose Format Cells. Go to the Alignment Tab, and if there is a tick in the Merge Cells box then they're merged
 
Upvote 0
The MergeCells property will tell you whether there are any merged cells in a range.
 
Upvote 0
When you click on any of the suspected cells, if they are merged, the cell outline will include all of them. If you have your grid turned on, the grid will show you which cells are merged.
 
Upvote 0
The function below will return true or false if any cells are merged within the range you want to check: -

Public Function IsItMerged(myRange As Range) As Boolean
Dim c As Range

For Each c In myRange
If c.MergeCells Then
IsItMerged = True
Exit Function
End If
Next c

IsItMerged = False

End Function
 
Upvote 0
Thx all, Thx Mudface!!! That's the answer :)
Even though i haven't state the question clearly, you can get what i mean!! Great!!
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top