Hi
I am trying to create a userform to input data into an Excel spreadsheet.
I have created a command click button called Submit.
The code for the button is below
Private Sub CommandButton1_Click()
Dim lastrow As Long
lastrow = Sheets("StockSheet").Range("Stock" & Rows.Count).End(x1Up).Row + 1, "Stock").Value = TextBox1.text
End Sub
Stocksheet = the sheet name
Stock = Column named Stock
TextBox1 = the text box created in the userform
I get a compile syntax error
I am trying to create a userform to input data into an Excel spreadsheet.
I have created a command click button called Submit.
The code for the button is below
Private Sub CommandButton1_Click()
Dim lastrow As Long
lastrow = Sheets("StockSheet").Range("Stock" & Rows.Count).End(x1Up).Row + 1, "Stock").Value = TextBox1.text
End Sub
Stocksheet = the sheet name
Stock = Column named Stock
TextBox1 = the text box created in the userform
I get a compile syntax error