Thread: find
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ranswert ranswert is offline
external usenet poster
 
Posts: 161
Default find

Thanks I'll try that

"Dave Peterson" wrote:

With rng
Set xcell = .find(what:=drwno, LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByColumns)

if xcell is nothing then
'not found, what happens
exit sub 'maybe???
else
a = xcell.Offset(0, 10).Value
....



ranswert wrote:

I have the following code:

With rng
Set xcell = .find(what:=drwno, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlByColumns)
a = xcell.Offset(0, 10).Value
xcell.Offset(0, 10).Select
If a < linkno Then
cnt = 0
Do
cnt = cnt + 1
Set xcell = .FindNext(xcell)
a = xcell.Offset(0, 10).Value
Loop While a < linkno And cnt < drwitemnum + 1
xcell.Select
End If
End With

How do I get the procedure to skip 'find' if there is no 'drwno' in the range?
Thanks


--

Dave Peterson