GingerBeardo
New Member
- Joined
- Feb 20, 2019
- Messages
- 25
I have a user form that accepts dates that certs have been issued, then when the "submit" button is hit sends it to the corresponding column on the sheet. I would like for what is in the columns to show the due date instead but the options I have googled either arent for my specific needs or I dont understand. attached is my code, right now it just sends the input to the sheet as is.
VBA Code:
Private Sub Label9_Click()
End Sub
Private Sub UserForm_Initialize()
With cmbPosition
.AddItem "Trainee"
.AddItem "Operator I"
.AddItem "Operator II"
.AddItem "Operator III"
End With
End Sub
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 'End(xlUp) jumps to the next free cell
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) = txtPEC.Text
ws.Cells(freeRow, 10) = txtH2S.Text
ws.Cells(freeRow, 11) = txtCS.Text
ws.Cells(freeRow, 12) = txtFT.Text
ws.Cells(freeRow, 13) = txtFA.Text
ws.Cells(freeRow, 14) = txtCPR.Text
ws.Cells(freeRow, 15) = txtBBP.Text
ws.Cells(freeRow, 16) = txtFS.Text
ThisWorkbook.Save
cmbPosition.Text = ""
txtFName.Text = ""
txtLName.Text = ""
txtDOB.Text = ""
txtPhone.Text = ""
txtLast4.Text = ""
txtPEC.Text = ""
txtH2S.Text = ""
txtCS.Text = ""
txtFT.Text = ""
txtFA.Text = ""
txtCPR.Text = ""
txtBBP.Text = ""
txtFS.Text = ""
cmbPosition.SetFocus
End If
End If
End Sub