如何进行for / next循环跳转/跳过值?

时间:2015-04-10 08:00:20

标签: excel vba

我想在Excel VBA中循环迭代值1,2,4,5,6,7,8,9,10,11,13。

从1到13,跳过3。

Dim i As integer
For i = 1 To 13 "Skip 3"
...
Next i

这可能吗?

1 个答案:

答案 0 :(得分:1)

Dim i As integer
For i = 1 To 13
    If i <> 3 Then
         'Do stuff
    Else
         'Do nothing, or something else
    End If
Next i