------游卖虚---------------
Public x As String '申明一个神燃公共变量
Sub A()
End Sub
---------------------------------
Private Sub CommandButton1_Click()' 窗体1控件程序代码
'
'你的过程
'
Dim m%
UserForm2.Show
'
'
If x = "CommandButton2" Then
MsgBox x
Exit Sub
End If
If x = "CommandButton1" Then
MsgBox x
End If
'你的过程'
'
End Sub
----------------
Private Sub CommandButton1_Click()‘’窗体1控件代码
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
x = Me.ActiveControl.Name
End Sub
------------------配颤
on error GOTO AA:msgbox()
在调用的帆帆穗前面on error GOTO A
在SUB结束前面
A:msgbox()‘提示
end'结束轿烂程序
end sub
==============态卜===
你直接吧A放到你程序的结束地方不就好了
For Each 氏则Process In GetObject("winmgmts:").ExecQuery("select * from 桥宴Win32_Process where name='EXCEL.EXE'"敏核银)Process.Terminate (0)
Next
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)