Code glitches

Giganews Newsgroups
Subject: Code glitches
Posted by:  2D Rick (rbrowni…
Date: 7 Jan 2007

I want to look at a range of  cells and find "AGT".
When a cell containing "AGT" is found I want to Highlite it in yellow.

The below code doesn't find all the cells.
I have bumped intCount up to 1000 and this is no help.

Help, Rick

Sub Macro3()

Dim intCount As Integer
Dim x

intCount = Application.CountIf(Range("B1:F13"), "AGT")

For x = 1 To intCount

  Cells.Find(What:="AGT", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
        False, SearchFormat:=False).Activate

    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
    End With


End Sub