Stop a find after the last occrance of the search value.
See the example for the Find method... it shows you exactly how to set up
the loop. To get to the help files for it, put the text cursor on the word
Find and press F1.
--
Rick (MVP - Excel)
"Pats" wrote in message
...
Is there any way to cause this routine to stop when it finds the last
occurance of NoXXX and not start over at the top of the worksheet?
Sub NextRow()
'
' Macro4 Macro
'
'
Cells.Find(What:="NoXXX", After:=ActiveCell, LookIn:=xlValues, LookAt:=
_
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
|