返回列表 上一主題 發帖

[發問] 模組程序結束問題

[發問] 模組程序結束問題

目前有個程式碼如下
當在CommandButton4執行中,會call模組程式text123
text123中有一判斷式if a<>b then exit sub
但exit sub只會結束模組程式的執行,隨後又跳回CommandButton4繼續執行
能否在exit sub時,直接結束掉程式執行??





Sub CommandButton4_Click()
Dim myrng As Range
Dim num$, myrow%, dn!, an!, name$, i%
Sheet3.Range("a1:f65535").ClearContents
Sheet1.Range("aa1:ad65535").ClearContents
...........................
..........................................

call text123
......................................
..............................................
end sub
-----------------------------------------------------------------
sub text123
..........
if a<>b then exit sub
........................
end sub

這麼簡單,我卻不會,代表我學的還不夠.....
感謝~

TOP

        靜思自在 : 我們最大的敵人不是別人.可能是自己。
返回列表 上一主題