Thread: Loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_6_] Otto Moehrbach[_6_] is offline
external usenet poster
 
Posts: 201
Default Loop

Esau
As written, your macro is illogical and will produce an error if
FoundCell is nothing. Post back and detail exactly what you want this macro
to do. HTH Otto
"Esau" wrote in message
...
How do I stop this after the last life o I am new and not very good at

this

Sub life_o()
Range("A1:A8000").Select
Do

Set FoundCell = Cells.Find(What:="life o", After:=ActiveCell, _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False)
If FoundCell Is Nothing Then
Else
FoundCell.Offset(0, 1).Select
End If
FoundCell.Offset(0, 1).Select
ActiveCell.Value = "1"
ActiveCell.Offset(0, -1).Select
Loop Until FoundCell Is Nothing
End Sub