AndrewGKenneth
Board Regular
- Joined
- Aug 6, 2018
- Messages
- 59
Hi there,
I am having a bit of an issue with what I am trying to achieve. On my sheet I have several active x textboxes and a command button. What I would like to happen is that when the user clicks the command button on the sheet, the data from the active x textboxes will be added to the sheet named start in the correct columns. Each time the user presses the command button the data should automatically be added to the next emptyrow on sheet "Start". At the moment, my code is just replacing the data on the same row each time the command button is clicked.
Here is my code:
Private Sub CommandButton_START_Click
With Me
EmptyRow = WorksheetFunction.CountA(Range("G:G")) + 1
Sheets("Start").Cells(EmptyRow, 6).Value = TextBox_UniqueIdentifier
Sheets("Start").Cells(EmptyRow, 8).Value = TextBox_Process.Value
Sheets("Start").Cells(EmptyRow, 10).Value = Operation_Follow.Value
Sheets("Start").Cells(EmptyRow, 11).Value = TextBox_ProductNumber.Value
Sheets("Start").Cells(EmptyRow, 12).Value = TextBox_TotalQuantity.Value
Sheets("Start").Cells(EmptyRow, 13).Value = TextBox_EmployeeNumber.Value
Sheets("Start").Cells(EmptyRow, 14).Value = TextBox_EmployeeName.Value
Sheets("Start").Cells(EmptyRow, 15).Value = Now()
End With
End Sub
If anyone could correct my code or give me anything different that would be much apprieciated
I am having a bit of an issue with what I am trying to achieve. On my sheet I have several active x textboxes and a command button. What I would like to happen is that when the user clicks the command button on the sheet, the data from the active x textboxes will be added to the sheet named start in the correct columns. Each time the user presses the command button the data should automatically be added to the next emptyrow on sheet "Start". At the moment, my code is just replacing the data on the same row each time the command button is clicked.
Here is my code:
Private Sub CommandButton_START_Click
With Me
EmptyRow = WorksheetFunction.CountA(Range("G:G")) + 1
Sheets("Start").Cells(EmptyRow, 6).Value = TextBox_UniqueIdentifier
Sheets("Start").Cells(EmptyRow, 8).Value = TextBox_Process.Value
Sheets("Start").Cells(EmptyRow, 10).Value = Operation_Follow.Value
Sheets("Start").Cells(EmptyRow, 11).Value = TextBox_ProductNumber.Value
Sheets("Start").Cells(EmptyRow, 12).Value = TextBox_TotalQuantity.Value
Sheets("Start").Cells(EmptyRow, 13).Value = TextBox_EmployeeNumber.Value
Sheets("Start").Cells(EmptyRow, 14).Value = TextBox_EmployeeName.Value
Sheets("Start").Cells(EmptyRow, 15).Value = Now()
End With
End Sub
If anyone could correct my code or give me anything different that would be much apprieciated