Basically, i want to show a "record" in a table, upon the user selecting a code on the form. Heres the sub im having problems with.
Private Sub CommandButton1_Click()
Dim Searchkey As String
Searchkey = Code.Text
Sheets("Shipping and Payment").Select
Range("D5").Select
Do While ActiveCell <> ""
If ActiveCell.Text = Searchkey Then
ActiveCell.Offset(0, 1).Value = Telephone.Text
'Where "telephone" is the name of the textbox
ActiveCell.Offset(0, 1) = Invoicedate.Text
ActiveCell.Offset(0, 1) = CurrentPaymentstatus.Text
ActiveCell.Offset(0, 1) = Currentshippingstatus.Text
GoTo Lastline
End If
ActiveCell.Offset(1, 0).Activate
Loop
Lastline:
End Sub
Can anyone help as to how i can get cell values to show in textboxes on an userform?
Private Sub CommandButton1_Click()
Dim Searchkey As String
Searchkey = Code.Text
Sheets("Shipping and Payment").Select
Range("D5").Select
Do While ActiveCell <> ""
If ActiveCell.Text = Searchkey Then
ActiveCell.Offset(0, 1).Value = Telephone.Text
'Where "telephone" is the name of the textbox
ActiveCell.Offset(0, 1) = Invoicedate.Text
ActiveCell.Offset(0, 1) = CurrentPaymentstatus.Text
ActiveCell.Offset(0, 1) = Currentshippingstatus.Text
GoTo Lastline
End If
ActiveCell.Offset(1, 0).Activate
Loop
Lastline:
End Sub
Can anyone help as to how i can get cell values to show in textboxes on an userform?