Find Merged-cells

C

CLR

Hi All.......
The F5-Goto feature works well for what it does. It does not allow finding
of MergedCells.......Is it possible to do this by code?......either
highlighting or changing the background color.....and then maybe being able
to reverse them back to the previous colors?

TIA
Vaya con Dios,
Chuck, CABGx3
 
G

Gary''s Student

This will find and color all merged cells:

Sub FindMerge()
Dim rsel As Range, r As Range
Set rsel = Nothing
For Each r In ActiveSheet.UsedRange
If r.MergeCells = True Then
If rsel Is Nothing Then
Set rsel = r
Else
Set rsel = Union(rsel, r)
End If
End If
Next

If rsel Is Nothing Then
Else
rsel.Interior.ColorIndex = 3
End If
End Sub
 
C

CLR

OUTSTANDING!!!.........that will do me just fine......thank you very much
Gary"s Student.

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top