I just made a little program in Excel that tells what key you pressed. Try this.
Code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
TextBox2.Text = TextBox2.Text & vbCrLf & "KeyCode = " & CStr(KeyCode)
TextBox1.SetFocus
End Sub
Private Sub UserForm_Initialize()
Move 0, 0, 570, 380
TextBox1.Move 30, 40, 220, 160
TextBox1.MultiLine = True
TextBox1.WordWrap = True
TextBox1.Text = "Type text here."
TextBox1.EnterKeyBehavior = True
TextBox2.Move 298, 40, 220, 160
TextBox2.MultiLine = True
TextBox2.WordWrap = True
TextBox2.Text = "ASCII code"
TextBox2.Locked = True
TextBox2.ScrollBars = fmScrollBarsVertical
End Sub
Set up a user form with 2 textboxes (textbox1 and textbox2).
Does this work for all situations? I don't know.
[Edited by billwagnon on 05-25-2000 at 03:03 PM]