Hello, I have a userform with a textbox1 on it. and when the userform launches I would like to have the cursor already in it. This textbox is in the number 1 position on the tab order, and I have set the focus on it when the form launches but I still have to click inside the textbox to get the cursor in it to enter data. Can anyone offer any input on why the code isn't putting the cursor in to the textbox?
Thanks,
(I am using a QR scanner to enter the data so that it why I dont want to have to manually click in the text box, I want the cursor already there)
Thanks,
(I am using a QR scanner to enter the data so that it why I dont want to have to manually click in the text box, I want the cursor already there)
Code:
Private Sub UserForm_Initialize()
Dim i As Long
Dim Lastrow As Long
TextBox1.SetFocus
'this is from the DEVICE ID column
Lastrow = Cells(Rows.Count, "L").End(xlUp).Row
For i = 1 To Lastrow
If Cells(i, 15).Value = "" Then ListBox1.AddItem Cells(i, 12).Value
Next
Me.RemainingCountBox.Text = CStr(ThisWorkbook.Sheets("Emergency Lighting Log").Range("M1").Value)
End Sub