I am new to VBA and userforms. I cannot get my userform to transfer to my worksheet. This is what I have. I did little steps to see if it would go. It did not. Please help.
Private Sub submitcmd_Click()
Dim invoicedate As Date
Dim invoicenumber As Long
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Invoice")
Dim nextRow As String
nextRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
ws.Range("A" & nextRow) = invoicedatetxt.Value
ws.Range("B" & nextRow) = invoicenumbertxt.Value
End Sub
Private Sub submitcmd_Click()
Dim invoicedate As Date
Dim invoicenumber As Long
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Invoice")
Dim nextRow As String
nextRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
ws.Range("A" & nextRow) = invoicedatetxt.Value
ws.Range("B" & nextRow) = invoicenumbertxt.Value
End Sub