在EXCEL中用功能键(比如用F2)调用VBA中用户窗口打开后,如何用Esc键关闭窗口?

2025-05-01 11:52:11
推荐回答(1个)
回答1:

Private Sub UserForm_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 27 Then Unload Me
End Sub

代码写在窗体中