簡體   English   中英

Excel VBA跳過執行while循環

[英]Excel VBA Skip Do while loop

如何使用continue語句跳過循環以進行下一次迭代。 因此,如果條件失敗,則循環必須進行下一次迭代

代碼如下:

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

也許你在追求這個

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM