Welcome to FreeSoftwareServers Confluence Wiki



  • KeyUp = When Key Is Released
  • KeyDown = When Key Is Pressed
  • I was able to use KeyUp for vbKeyEscape, but not for vbKeyReturn. While both worked w/ KeyDown. There for I'll only use KeyDown moving forward.

Private Sub TextBox2_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
 If KeyCode = vbKeyReturn Then
  Call OkButton_Click
 ElseIf KeyCode = vbKeyEscape Then
  Call CancelButton_Click
 End If
End Sub
  • No labels