Hi I have 3 listboxes and wants to transfer the data to an spreadsheet.
Thanks
Hi I have 3 listboxes and wants to transfer the data to an spreadsheet.
Thanks
Anywhere in particular in a workbook you want the data to go?
Are the listboxes multiselect?
Also, where are the listboxes located/
If posting code please use code tags, see here.
I want it to be in Worksheet("Database")
THe listboxes are filled using 2 textboxes and 1 combobox on a userform
Listboxes are located on a userform
Why not 1 listbox with 3 columns, 2 filled from the textboxes and 1 from the combobox?
That assumes the 3 listboxes are linked of course.
Anyway, if you have 3 listboxes and you want to transer all the data in each to separate columns on a worskheet.
![]()
Please Login or Register to view this content.
Thanks,
Yes I was actually thinking to have just 1 listbox with 3 columns but I dont know how to specify the columns. I have 1st textbox ( No of Users) - Column 1 ,2nd textbox (Locations)- Column 2 and a Combobox (teams) in Column 3. Can you please provide me with the VBA code
1. How to specify each column (headings)
2. If I click the add button how can I see all the information in the listbox
3. How can I transfer the information from the listbox to the database Worksheet
I have tried the above code but it seems not working what is varlist?
Thanks
1 You can only have headings in a listbox if you populate it from a range, you could just use labels placed above the listbox instead.
2 Not sure what you mean. Do you mean how would you transfer the data from the textboxes/combobox to the listbox?
3 The code I posted should transfer the data from 3 listboxes on a userform to a worksheet called 'Database'.
I've only tested lightly with hard-coded lists/value and it does work, how isn't it working for you?
varList is just a variable that will hold the list of values from each listbox in an array and is then used to transfer those values to the worksheet.
Can you upload an example workbook?
Click on GO ADVANCED and use the paperclip icon to open the upload window.
Thanks
I am trying to get the value from 2 texboxes and 1 combobox to a listbox and transfer it to excel. See my sample spreadsheet userform 1
Mmm, a sample workbook with nothing in it.![]()
hey Sorry, seems like I didnt save the sample sheet. Your code works well. Thanks A lot.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks