View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Stop the loop after it runs for 10 times.


sub loop12()'NO selections
mc=activecell.column
for i= 1 to 10
if cells(i,mc)=10 then cells(i,mc+1)=15
next i
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heera" wrote in message
...
Hi,

I want to run the below mentioned loop for only 10 times.
Does anyone know how to stop the loop after it complete 10 rounds.

Sub LOOP12()

Do Until ActiveCell.Value = ""

If ActiveCell.Value = 10 Then

ActiveCell.Offset(0, 1).Value = 15

End If

ActiveCell.Offset(1, 0).Select

Loop

End Sub

Regards
Heera