Find method - finding multiple values
thanks.
"John" wrote:
Nathan
try something like this...
Dim rngToSearch As Range
Dim wks As Worksheet
Dim rngFound As Range
Dim WhatToFind As Variant
Dim iCtr As Long
Dim DestCell As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set wks = Sheets("sheetname")
Set rngToSearch = wks.Columns(6)
WhatToFind = Array("1", "2", "3")
For iCtr = LBound(WhatToFind) To UBound(WhatToFind)
With rngToSearch
Set rngFound = .Cells.Find(what:=WhatToFind(iCtr), _
LookIn:=xlValues, lookat:=xlWhole, _
after:=.Cells(.Cells.Count), _
MatchCase:=False)
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
"nathan" wrote:
Is there simple way to use "find" to search for more than one string? i.e.
find "b" or find "s", without running separate a "find" code for each string.
this doesn't work, but explains what I want to do: .find(what:="b" or "s")
thanks again.
|