gpt4 book ai didi

vba - 在for循环中更新for循环的上限/界限

转载 作者:行者123 更新时间:2023-12-04 20:17:44 26 4
gpt4 key购买 nike

我试图在 for 循环中更新我的 for 循环的上限。

例子

numvar = 3

for i=2 To numvar Step 2

'code...

numvar = numvar +1

next numvar

感谢您的帮助!

最佳答案

改为使用 While 或 Until 循环:

numvar = 3
i = 2
while i <= numvar
'code ...
numvar = numvar +1
i = i + 2
wend

关于vba - 在for循环中更新for循环的上限/界限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18452235/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com