Hello,
I have the Userform that is complete and it adds a record at the end of the table as designed -yet it would be nice if the Userform could auto populate the form with existing Employee Data if it already is there!
Below is a copy of the Userform code
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("EmployeeData").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtfullname
ActiveCell.Offset(0, 0) = txtfullname.Value
ActiveCell.Offset(0, 1) = txthiredate.Value
ActiveCell.Offset(0, 2) = txtaht.Value
ActiveCell.Offset(0, 3) = txtacw.Value
ActiveCell.Offset(0, 4) = txtquality.Value
ActiveCell.Offset(0, 5) = cbodepartments.Value
ActiveCell.Offset(0, 6) = txtadherence.Value
ActiveCell.Offset(0, 7) = txtvoc.Value
ActiveCell.Offset(0, 8) = txtnps.Value
ActiveCell.Offset(0, 9) = txtfcr.Value
ActiveCell.Offset(0, 10) = cboteams.Value
If chkActive = True Then
ActiveCell.Offset(0, 10).Value = "Yes"
Else
ActiveCell.Offset(0, 11).Value = " "
End If
Range("A1").Select
End Sub
Private Sub FormBack_Click()
End Sub
Private Sub cmdreset_Click()
txtfullname.Text = ""
txthiredate.Text = ""
txtaht.Text = ""
txtacw.Text = ""
txtquality.Text = ""
cbodepartments.Text = ""
txtadherence.Text = ""
txtvoc.Text = ""
txtnps.Text = ""
txtfcr.Text = ""
cboteams.Text = ""
End Sub
Private Sub UserForm_Initialize()
End Sub
Any help would be great!
Best Regards,
John
Bookmarks