2016-11-18 75 views
0

如何使用continue语句跳过下一次循环的循环。所以,如果条件不满足的循环就必须为下一次迭代Excel VBA Skip Do while循环

的代码去如下:

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

回答

1

也许你就是这

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