
Sub Badloop()
Dim cell As Range
Dim area As Range
Dim i As Long
Set area = Range("a2:a4")
Do
For Each cell In area
For i = 1 To 10
cell.Offset(0, i).Interior.Color = 3
Next i
Next cell
Loop While cell.Value = "OK!"
End Sub
|
Sub Badloop()
Dim cell As Range
Dim area As Range
Dim i As Long
Set area = Range("a2:a4")
For Each cell In area
If cell.Value = "ok!" Then
For i = 1 To 10
cell.Offset(0, i).Interior.Color = 3
Next i
End If
Next cell
End Sub |
