Hello again!
Could anyone please help me with the below?
I have a userForm to capture various data into excel sheet. everything works fine but i have two things to add and zero idea how to do it.
1. add data entry from a option boxes...
There are 2 groups of optionBoxes - "Unit" (3 to choose - UNIT A, UNIT B, UNIT C) and "type" - 9 to choose - red1 red2 etc....
I would like the user to be able to select ONE unit and ONE Type and after the form is submitted it would add the exact values into specific row as in the code below. (Grouping is done)
Here's thecode I already have:
Private Sub cmdSubmit_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("Workers")
nr = ssheet.Cells(Rows.Count, 3).End(xlUp).Row + 1
Cells(nr, 3) = Me.boxSurname.Text
Cells(nr, 4) = Me.boxForename.Text
Cells(nr, 6) = Me.boxPhone.Value
Cells(nr, 9) = Me.boxDob.Value
Cells(nr, 16) = Me.boxoptout.Text
MsgBox "Employee Added"
UserForm1.Hide
End Sub
Private Sub boxDob_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
On Error Resume Next
Me.boxDob = Format(Me.boxDob, "dd/mm/yyyy")
End Sub
Private Sub boxIdexp_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
On Error Resume Next
Me.boxIdexp = Format(Me.boxIdexp, "dd/mm/yyyy")
End Sub
Also i would like it to convert the input of "y" in
Cells(nr, 16) = Me.boxoptout.Text
into UPPERCASE automaticly before submitting data.
And Finally at the very end I would like the form to clear before it closes.
Any help would be amazing!
Bookmarks