PDA

View Full Version : How do i print LISTBOX CONTENTS INTO EXCELL SPREADSHEET



dkipnai
05-10-2010, 02:16 PM
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

Simon Lloyd
05-10-2010, 02:53 PM
You would be better off posting a workbook, however you simply reference the value of the listbox like this:

Range("A1") = Userform2.ListBox1.Value

dkipnai
05-11-2010, 11:01 AM
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

Simon Lloyd
05-11-2010, 12:20 PM
Please post a workbook so we can see how and where you get your listbox data from.