Perform FIND Starting from the beginning of the Range

  • Thread starter Thread starter 1clncc
  • Start date Start date
1

1clncc

when searching within a specificed range

*****************************************************
Set c = range("Postcode").find(.....etc.....)
if c is nothing then
....it didn't find anything............
end if
*****************************************************

it seems the find will start at the 2nd row of the Range, skipping the
first one.

1) How to code the search for the entire range?

2) where to find the complete descriptive parameters for the Find
operations.
(e.g. (What:=sVal, _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

More?
 
#1. I like to start with the last cell in the range and find the next
occurance. Since I'm starting with the last one, the next one found can be the
first cell in the range.

with worksheets("sheet9999")
with .range("a:a")
set foundcell = .cells.find(what:="whattofind", _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
lookat:=xlWhole, _
searchorder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False)
end with
end with

Note that if you don't specify these options, then both excel and VBA will use
the last settings that were used--either in VBA or in code. It's better to
always specify everything.

#2. Try VBA's help.
 
Back
Top