Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi all, i have te code below but it doesnt add the data onto a new line automatically can you help me please. For example i have a userform to fill out and in that i have a command button2 that when click will transfer the data added to sheet4, but it keeps overwriting on the same line and doesnt start a new line when userform is filled out again. hope you can help please.
Code:
Private Sub CommandButton2_Click()
Dim emptyRow As Long
With ThisWorkbook.Sheets("Sheet4")
emptyRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
.Cells(emptyRow, 1).Value = TextBox1.Value
.Cells(emptyRow, 2).Value = ComboBox1.Value
End With
Unload Me
End Sub
Last edited: