我有以下代码:
For x = LBound(arr) To UBound(arr)
sname = arr(x)
If InStr(sname, "Configuration item") Then
'**(here I want to go to next x in loop and not complete the code below)**
End If
'// other code to copy past and do various stuff
Next x
我以为我可以简单地发表声明Then Next x
,但这会给出“没有声明 for 语句”错误。
后面可以放什么If InStr(sname, "Configuration item") Then
使其继续到 x 的下一个值?
您可以使用GoTo
:
Do
'... do stuff your loop will be doing
' skip to the end of the loop if necessary:
If <condition-to-go-to-next-iteration> Then GoTo ContinueLoop
'... do other stuff if the condition is not met
ContinueLoop:
Loop
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)