2
2D Rick
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
ActiveCell.Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Cells.FindNext(After:=ActiveCell).Activate
Next
End Sub
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
ActiveCell.Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Cells.FindNext(After:=ActiveCell).Activate
Next
End Sub