【问题标题】:Excel VBA Skip Do while loopExcel VBA跳过执行while循环
【发布时间】:2017-04-01 22:03:28
【问题描述】:

如何使用 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

【问题讨论】:

    标签: excel vba


    【解决方案1】:

    也许你在追求这个

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-07
      • 2021-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多