Thread: Do Loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Do Loop

On 3 Aug, 14:04, AlanW wrote:
Could anyone please tell why the funnel is kept running without stopping even
after the expected task is completed.

Sub Macro()
Do Until blanks
For Each cell In Range("A1:A10")
Select Case cell.Value
Case "W"
cell.Offset(0, 1).Interior.ColorIndex = 1
Case "Q"
cell.Offset(0, 1).Interior.ColorIndex = 7
Case Else
cell.Offset(0, 1).Interior.ColorIndex = 9
End Select
Next
Loop
End Sub

Thank you


You have told it to run until an undeclared variable called Blanks is
true, which is never referred to again!