开发者

VBA for loop addition

开发者 https://www.devze.com 2023-04-07 04:48 出处:网络
I am trying to write a loop that adds odd numbers up to a certain point. How can I get the inte开发者_开发技巧ger i to go up by 2. I know there is a way, it\'s something like i by 2, but I don\'t reme

I am trying to write a loop that adds odd numbers up to a certain point. How can I get the inte开发者_开发技巧ger i to go up by 2. I know there is a way, it's something like i by 2, but I don't remember the exact command. If anyone could please help me, I would appreciate it


Do you mean:

For i = 1 To 9 Step 2

Next i

Or:

For i = 1 To 10
    If i Mod 2 = 1 Then
        '// Odd

    End If
Next i
0

精彩评论

暂无评论...
验证码 换一张
取 消