目前有個程式碼如下
當在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作者: GBKEE 時間: 2012-10-18 16:52