View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default Merged Cells Question

I'm not sure if there is a way to test that a row has merged cells. If you
want to unmerge cells in a range just use one of these procedures.

Sub UnMergeRange()

' unmerge all cells in the used range
Sheets("Sheet1").UsedRange.UnMerge

End Sub

or

Sub UnMergeRange()

' unmerge all cells in the range you specified
Sheets("Sheet1").Range("A1:P40".UnMerge

End Sub

Is this what you wanted? Hope this helps.
--
Cheers,
Ryan


"Jim" wrote:

if your Range.EntireRow contains merged cells how can you test for that and
if true, unmerge the cells?

i have something like this but not working.

Function MergeSub( )
Dim rng as Range
Set rngFound = Range("A1:P40")

If rng.MergeCells = True Then
rngFound.EntireRow.MergeCells = False
End If
End Function