I found a script at the Ozgrid website that allows you to add data from a textbox to col A by keyevent(hitting enter). I am trying to figure out how to reset the focus to the textbox after the enter key is hit. Below is my latest failed attempt. Any leads would be appreciated. I was thinking that the on change event would be the time to reset the focus but I am obviously on the wrong track.
Private Sub TextBox1_Change()
TextBox1.SetFocus
End Sub
The KeyDown Code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = 13 Then
Sheet1.Range("A65536").End(xlUp).Offset(1, 0) = TextBox1
TextBox1 = vbNullString
End If
End Sub
I have looked at all of the properties and read the help file on focus but can't seem to get this to work for me. Got to get that reference book from Mr. Excel!