I would like code against the KeyPress event of a TextBox in VBA application. I would like to detect which key has been pressed by the user when the user presses a key. I am wondering if there is way of doing that.
I would like in particular to know if the user has pressed the space key or a number key.
Thank you for your help.
Private Sub TextBoxI_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'need to know which key the user has pressed and take a an action based on the key pressed for example display a message box when the user presses space key.