窗体的KeyPreview属性设为truePrivate Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)If KeyCode = vbKeyA Then Command1_ClickEnd Sub