acousticlife81
New Member
- Joined
- Mar 29, 2017
- Messages
- 12
I am trying to create a form that allows the user to input data into certain fields. Here is the code for the Submit or Okay Button. The data needs to go from the form to cells B15:I15 AND then once entered add another entry to the next row C16:I16 and etc. Please if anyone can help it would be much appreciated.
'Here is the code!!!!!!!
Private Sub CommandButton2_Click()
Dim emptyRow As Long
'Make Sheet1 active
Sheet1.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = NameTextBox.Value
Cells(emptyRow, 2).Value = TaskTextBox.Value
Cells(emptyRow, 3).Value = AssignedByListBox.Value
Cells(emptyRow, 4).Value = StatusComboBox.Value
Cells(emptyRow, 5).Value = DateTextBox.Value
End Sub
'Here is the code!!!!!!!
Private Sub CommandButton2_Click()
Dim emptyRow As Long
'Make Sheet1 active
Sheet1.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = NameTextBox.Value
Cells(emptyRow, 2).Value = TaskTextBox.Value
Cells(emptyRow, 3).Value = AssignedByListBox.Value
Cells(emptyRow, 4).Value = StatusComboBox.Value
Cells(emptyRow, 5).Value = DateTextBox.Value
End Sub