Adding data to next empty row on separate sheet using a command button

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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
change this line of code

Code:
[COLOR=#333333]EmptyRow = WorksheetFunction.CountA(Range("G:G")) + 1[/COLOR]
to

Code:
EmptyRow= Sheets("Start").Range("G" & rows.count).end(xlup).row +1
 
Upvote 0

Forum statistics

Threads
1,214,566
Messages
6,120,266
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top