GingerBeardo
New Member
- Joined
- Feb 20, 2019
- Messages
- 25
Working with some checkboxes in a user form, when hitting submit and the info hits the sheet they are showing TRUE or FALSE, I need Yes or No and when, yes being the box in the form was checked and no if it is not checked. Below is the code for what the submit button is doing. If something doesn't quite make sense or seems a convoluted way of doing something it's because I don't really know what I am doing, it's what I've been able to make fit.
VBA Code:
Private Sub cmdSubmit_Click()
Dim ws As Worksheet
Dim freeRow As Long
If cmbPosition.Text = "" Or txtFName.Text = "" Or txtLName.Text = "" Or txtDOB.Text = "" Or txtPhone.Text = "" Or txtLast4.Text = "" Then
Else
Set ws = ActiveSheet
freeRow = ws.Cells(ws.Rows.Count, 2).End(xlUp).Row + 1
If Not ws Is Nothing Then
ws.Cells(freeRow, 2) = cmbPosition.Text
ws.Cells(freeRow, 3) = txtFName.Text
ws.Cells(freeRow, 4) = txtLName.Text
ws.Cells(freeRow, 5) = txtDOB.Text
ws.Cells(freeRow, 6) = txtLast4.Text
ws.Cells(freeRow, 7) = txtPhone.Text
ws.Cells(freeRow, 9) = cbPEC.Value
ws.Cells(freeRow, 10) = cbH2S.Value
ws.Cells(freeRow, 11) = cbCS.Value
ws.Cells(freeRow, 12) = cbFT.Value
ws.Cells(freeRow, 13) = cbFA.Value
ws.Cells(freeRow, 14) = cbCPR.Value
ws.Cells(freeRow, 15) = cbBBP.Value
ws.Cells(freeRow, 16) = cbFS.Value
ThisWorkbook.Save
cmbPosition.Text = ""
txtFName.Text = ""
txtLName.Text = ""
txtDOB.Text = ""
txtPhone.Text = ""
txtLast4.Text = ""
cbPEC.Value = ""
cbH2S.Value = ""
cbCS.Value = ""
cbFT.Value = ""
cbFA.Value = ""
cbCPR.Value = ""
cbBBP.Value = ""
cbFS.Value = ""
cmbPosition.SetFocus
End If
End If
End Sub