① vba goto璇鍙ヨ寖渚
鈥淕o to 鈥濆氨鏄鍘誨埌鍝鍎跨殑鎰忔濄侴o to 璇鍙ユ槸灝嗙▼搴忚漿鍒版寚瀹氱殑鏍囩劇殑璇鍙ヤ綅緗錛岀劧鍚庣戶緇寰涓嬫墽琛屻
Go to 璇鍙ラ氬父鐢ㄦ潵浣滈敊璇澶勭悊銆備笅闈涓哄ぇ瀹朵粙緇嶈ヨ鍙ョ殑紺轟緥銆
涓嬮潰鐨勪唬鐮佸姛鑳芥槸錛氭眰1鍒100鑷鐒舵暟涔嬪拰銆
Dim Lsum As Long, i As Long
i = 1
x: '涓篻o to 璇鍙ヨ劇疆鐨勬爣絳撅紝蹇呴』浠ヨ嫳鏂囩姸鎬佷笅鐨勫啋鍙風粨灝
Lsum = Lsum + i
i = i + 1
If i = 100 Then GoTo x '濡傛灉i=100,鍒欑▼搴忚煩鍒版爣絳綳澶
MsgBox "1鍒100鐨勮嚜鐒舵暟鍜屼負錛" Lsum