Thank You ALL, I love having more than one way of doing things.
What if I only wanted to highlight columns A: through I: and not the entire
row, what would be the syntax
"Bill Renaud" wrote:
> I added some variables to your code (it makes debugging much easier),
> and used a Find method, which should run much faster than iterating
> through each cell in the Compare range with a For loop. I also used the
> Color property, instead of the ColorIndex property, which might not be
> yellow, if the color pallette has been changed.
>
> Sub FindMatchesInZips()
> Dim rngCell As Range
> Dim rngSelection As Range
> Dim rngCompare As Range
>
> Set rngSelection = Selection
> Set rngCompare = Worksheets(2).Range("A2:A149")
>
> For Each rngCell In rngSelection
> If Not (rngCompare.Find(What:=rngCell.Value, _
> LookIn:=xlValues, _
> LookAt:=xlWhole, _
> SearchOrder:=xlByRows) Is Nothing) _
> Then
> rngCell.EntireRow.Interior.Color = vbYellow
> End If
> Next rngCell
> End Sub
> --
> Regards,
> Bill Renaud
>
>
>
>
|