Consulting

Results 1 to 7 of 7

Thread: Multiple Column Listbox help

  1. #1

    Multiple Column Listbox help

    Hi everyone,I am having real problems getting a listbox with 19 columns to populate, to be honest i cant even get the second column to populate, and it is driving me slightly mad!What i am using it for is to show search results from a huge list within the spreadsheet itself.Currently i am using 19 listboxes all stuck together, obv this isnt good enough. I have shown the code i use at the minute to populate these listboxes, is there anyway to convert this code to poulate 19 columns in a list box instead. I fear it may need an array :S

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    If you want to populate moire than 10 columns in a listbox, you will have to bind the data to the listbox.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Hi XLD,

    Thanks for the reply, how would i bind the data to the list box, is that done from the row source property of the listbox?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Yes that is it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    only thing is because the listbox will be showing results that vary i cannot put in the rowsource a definate range of cells if that makes sense. The way it works is people will run a search for all post received on a certain day for example and the listbox is required to show the relevant results, would this still work?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Then if you want all 19 columns you will have to do some work.

    Instead of loading all of the found rows directly into the listbox, you will need to save them into a worksheet, anjd then bind the listbox to that range.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Yeah thats what i was thinking i would have to do, its a bit longer but i could just create a named range and then populate that from the search.

    Thanks for the help!

Posting Permissions

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