morethan 1 data will be add from textbox to listbox then last data of the listbox will be add to worksheet. my code is
>>> use code - tags <<<
what is wrong in code i also attache sample file
>>> use code - tags <<<
Code:
Dim lastrow As Long
Dim x As Long
lastrow = Sheets("Data").Cells(Rows.Count, 1).End(xlUp).Row + 1
With UserForm1
For x = o To .ListBox1.ListCount - 1
Sheets("Data").Cells(lastrow, 1).Value = .ListBox1.List(x, 0)
Sheets("Data").Cells(lastrow, 2).Value = .ListBox1.List(x, 1)
Sheets("Data").Cells(lastrow, 3).Value = .ListBox1.List(x, 2)
Sheets("Data").Cells(lastrow, 4).Value = .ListBox1.List(x, 3)
Next x
End With