Loop
Will this get in a continual loop
Looks like it. What you want to do with the Find method is stop when you're
back to the first hit, since Excel will just keep finding the same cells.
So get the address of the first hit and then break out of the loop if a =
linkno or the address of xcell = the address of the first hit.
--
Jim
"ranswert" wrote in message
...
| Will this get in a continual loop if "a" never equals "linkno"?
|
| With rng
| Set xcell = .find(what:=drwno, LookIn:=xlValues,
| LookAt:=xlWhole, _
| SearchOrder:=xlByColumns)
| a = xcell.Offset(0, 10).Value
| MsgBox ("a = " & a)
| If a < linkno Then
| Do
| Set xcell = .FindNext(xcell)
| a = xcell.Offset(0, 10).Value
| Loop While a < linkno
| End If
| End With
| Thanks
|