+ Reply to Thread
Results 1 to 9 of 9

how to transfer information from a listbox to a spreadsheet

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    how to transfer information from a listbox to a spreadsheet

    Hi I have 3 listboxes and wants to transfer the data to an spreadsheet.

    Thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: how to transfer information from a listbox to a spreadsheet

    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.

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: how to transfer information from a listbox to a spreadsheet

    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

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: how to transfer information from a listbox to a spreadsheet

    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.

  5. #5
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: how to transfer information from a listbox to a spreadsheet

    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

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: how to transfer information from a listbox to a spreadsheet

    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.

  7. #7
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: how to transfer information from a listbox to a spreadsheet

    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
    Attached Files Attached Files

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: how to transfer information from a listbox to a spreadsheet

    Mmm, a sample workbook with nothing in it.

  9. #9
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: how to transfer information from a listbox to a spreadsheet

    hey Sorry, seems like I didnt save the sample sheet. Your code works well. Thanks A lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Transfer random listbox items to new listbox and then loop through selected items
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 05:58 PM
  2. Replies: 5
    Last Post: 06-20-2012, 12:18 PM
  3. Searching Spreadsheet Based on Listbox Information
    By radar_jynx in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2011, 02:16 AM
  4. userform listbox cannot get listbox.value to transfer back to main sub
    By malosky2@msn.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2006, 04:50 PM
  5. [SOLVED] Transfer information into Excel spreadsheet
    By Linda in forum Excel General
    Replies: 0
    Last Post: 01-17-2006, 08:50 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1