k56
k56

Reputation: 1

Excel VBA Skip Do while loop

How to use continue statement to skip the loop for next iteration. So that if condition fails the loop must go for next iteration

The code goes as follows:

Do While i<50 
    If IsEmpty(Cells(EndRow, 25)) = False Then
        Continue Do 
    Else 
        Cells(EndRow, 25).Interior.ColorIndex = 37 
    i = i+1 
LOOP

Upvotes: 0

Views: 1608

Answers (1)

user3598756
user3598756

Reputation: 29421

maybe you're after this

Do While i < 50
    If IsEmpty(Cells(EndRow, 25)) Then Cells(EndRow, 25).Interior.ColorIndex = 37
    i = i + 1
Loop

Upvotes: 1

Related Questions