was
used--either via code or via the userinterface.
If you look at the help for .find, you'll see all the options that can be
specified. (This is from xl2003.)
expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection,
MatchCase, MatchByte, SearchFormat)
It may be better to specify all the options that are available than to rely on
having the settings the way you want.
(Tom copied the example from the help -- which is less than robust.)
Jim said:
Tom.
This code finds and highlights all cells that include "2" anywhere within
the cell, like "1234". But what if you wanted only cells with the value
"2".
Tks,
Here is the help example for the FIND method:
This example finds all cells in the range A1:A500 that contain the value 2
and makes those cells gray.
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Pattern = xlPatternGray50
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With