① 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