Hi All
I have the following code for a user form that works fine, however I am new to userforms & cannot find how to get the cursor to start in the text box that i want, and after the user has submitted the data for it to return to this point. I know its probably being very daft of me but i cannot get the code correct.
The text box I want as starter point is called TextBoxSurname
The code at moment is:
Private Sub CommandButtonSUBMIT_Click()
Dim lrow As Long
lrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row + 1
With Sheet1
.Range("a" & lrow) = Me.TextBoxSurname.Value
.Range("B" & lrow) = Me.TextBoxPostcode.Value
.Range("C" & lrow) = Me.TextBoxMobile.Value
.Range("I" & lrow) = Me.cboMobile_BB.Value
.Range("D" & lrow) = Me.TextBoxHomeNumberSTD.Value
.Range("E" & lrow) = Me.TextBoxMain.Value
.Range("F" & lrow) = Me.TextBoxStartDate.Value
.Range("G" & lrow) = Me.TextBoxEnddate.Value
.Range("H" & lrow) = Me.cboBusiness.Value
End With
Unload Me
frmDataInput.Show
End Sub
cheers
Mark
Bookmarks