Private Sub CommandButton1_Click() Dim lRow As Long Dim ws As Worksheet Set ws = Worksheets(\'Sheet2\') lRow = ws.Cells(Rows.Count, 1).End(x1Up).Offset(1, 0).Row With ws.Cells(lRow, 1).Value =
Private Sub CommandButton1_Click()
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet2")
lRow = ws.Cells(Rows.Count, 1).End(x1Up).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = UserForm1.TextBox1.Value
.Cells(lRow, 2).Value = UserForm1.TextBox2.Value
End With
End Sub