Consulting

Results 1 to 4 of 4

Thread: How do i print LISTBOX CONTENTS INTO EXCELL SPREADSHEET

  1. #1

    How do i print LISTBOX CONTENTS INTO EXCELL SPREADSHEET

    Dear ladies and gentlemen:
    Please help me to complete my FIRST VBA project and start being a coder.

    I am just cutting my teeth so to speak in VBA programming.
    I have developed a small data sorting macro.

    I created my FIRST UserForm1
    On Userform1 I put two listboxes "A" and "B"
    I am able to select and move data from LISTBOX "A" and into LISTBOX "B"

    QUESTION:
    My next challenge is to capture the data in the LISTBOX "B" and PASTE IT in COLUMN "G" of the same ACTIVE SPREADSHEET where my Userform1 is located.

    Please help me to climb over this mountain.

    Thanks,

    Kipnai

  2. #2
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    You would be better off posting a workbook, however you simply reference the value of the listbox like this:

    Range("A1") = Userform2.ListBox1.Value
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    I have tried the ans by Simon. It works if theer is only one sentence in LISTBOX.

    Could you please let me know how to loop through the LISTBOX and get all the data copied into different rows starting at COLUMN "G1" on my spreadsheet.

    Thanks,

    Kipnai

  4. #4
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Please post a workbook so we can see how and where you get your listbox data from.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •