(1)Goto line 该语句为跳转到line语句行 (2) On expression gosub destinatioinlist 或者 on expression goto destinationlist 语句为根据 exprssion表达式值来跳转到所要的行号或行标记 (3)Gosub line…line…Return语句, Return 返回到 Gosub line行,如下例:
Sub gosubtry() Dim num Num=inputbox(“输入一个数字,此值将会被判断循环”) If num>0 then Gosub Routine1 :Debug.print num:Exit sub Routine1: Num=num/5 Return End sub(4)while…wend语句,只要条件为TRUE,循环就执行,这是以前VB老语法保留下来的,如下 例:
while condition ‘while I<50 [statements] ‘I=I+1 wend ‘Wend
标签:语句,Gosub,vba,Return,goto,num,line From: https://www.cnblogs.com/shizunatsu/p/17187584.html