• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

listbox data to worksheet

Status
Not open for further replies.

delta

Member
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 <<<
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
what is wrong in code i also attache sample file
 

Attachments

  • List_To Worsheet.xlsm
    21.7 KB · Views: 4
Status
Not open for further replies.
Back
Top