ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Merge Cells (https://www.excelbanter.com/excel-programming/358653-excel-merge-cells.html)

[email protected]

Excel Merge Cells
 
Is there anyway to find out if a particular cells is merged? I need to
unmerged cells in a spreadsheet where there could be merged or umerged
cells. How can I find out if a cells is merged?

Guidance welcome.


Paul B

Excel Merge Cells
 
Here is a macro that may help,

Sub Found_Merged_Cells()
'will select the merged cell in a worksheet
Dim mc As Range
For Each cell In ActiveSheet.UsedRange.Cells
If cell.MergeCells Then
If mc Is Nothing Then
Set mc = cell
Else
Set mc = Union(mc, cell)
End If
End If
Next
mc.Select
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

wrote in message
oups.com...
Is there anyway to find out if a particular cells is merged? I need to
unmerged cells in a spreadsheet where there could be merged or umerged
cells. How can I find out if a cells is merged?

Guidance welcome.




Dave Peterson

Excel Merge Cells
 
If you want to unmerge all the cells that might be merged:

ActiveSheet.Cells.MergeCells = False

It won't hurt if there are no merged cells.

But it will unmerge all of them--is that what you wanted?

" wrote:

Is there anyway to find out if a particular cells is merged? I need to
unmerged cells in a spreadsheet where there could be merged or umerged
cells. How can I find out if a cells is merged?

Guidance welcome.


--

Dave Peterson


All times are GMT +1. The time now is 10:55 PM.

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