G
Guest
I have a "Find_Duplicates" macro that turns the fill color red for cells that
are a duplicate of the preceding row.
Now what I need is a macro that searches for these cells with the red fill
color. I tried to record the steps of the find and got:
With Application.FindFormat.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=True).Activate
This doesn't work as a macro. I get this error message:
Run-time error '91':
Object variable or With block variable not set.
And if I can get this "find" working, I need to know how to recover if there
is nothing to find.
I appreciate any help you can give me.
Thank you, Judy
are a duplicate of the preceding row.
Now what I need is a macro that searches for these cells with the red fill
color. I tried to record the steps of the find and got:
With Application.FindFormat.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=True).Activate
This doesn't work as a macro. I get this error message:
Run-time error '91':
Object variable or With block variable not set.
And if I can get this "find" working, I need to know how to recover if there
is nothing to find.
I appreciate any help you can give me.
Thank you, Judy