Thread: Do Loop
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Do Loop

The do until "blanks" does nothing and the do/loop is doing nothing. All you
need is the for/next loop

Sub DocolorMacro()
For Each c In Range("A1:A10")
Select Case cell.Value
Case "W":x=1
Case "Q":x=7
Case Else:x=9
End Select
c.Offset(,1).Interior.ColorIndex = x
Next c
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"AlanW" wrote in message
...
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