+ Reply to Thread
Results 1 to 5 of 5

ListBox with multiple table sources

Hybrid View

  1. #1
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    ListBox with multiple table sources

    Hello everyone,

    I have a userform with a listbox with the following code:

        Me.ListBox1.RowSource = "table1"
    This shows me all values in column A from table1 in the ListBox.
    However I would like to fill the ListBox with multiple tables. Let's say "table1" and "table3".

    How can I achieve this?

    Kind regards,

    Marco

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: ListBox with multiple table sources

    Why have multiple tables?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: ListBox with multiple table sources

    Hello royUK,

    Good question. My sheet is an anime list, keeping track of all shows I watch.
    On my first sheet I have multiple tables, like: "Watching", "Completed", "Planning to Watch", etc.
    I have a code running which moves the rows to their corresponding table depending on the number of episodes I enter.

    I didn't have this before, I used to have it in one table. But then I got the code for moving the rows, as said earlier.
    When I used just the one table, I had a Named Range filling the ListBox, as such:
    Me.ListBox1.RowSource = "NamedRange"
    That still works, but now it shows the header for the tables below the first one as well...
    Example:

    Table1:
    ColumnA
    HEADER
    Value1
    Value2
    Value3

    Table2:
    ColumnA
    HEADER
    Value4
    Value5
    Value6

    The ListBox then shows:
    Value1
    Value2
    Value3
    HEADER
    Value4
    Value5
    Value6

    I don't want the headers to be in the ListBox. So that's why I wondered if it's possible to have more than one table as a source for a ListBox.

    Kind regards,

    Marco

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: ListBox with multiple table sources

    Not well thought out. You need one table with a column that shows the status - "Watching", "Completed", "Planning to Watch", etc. You can then use AutoFilter to view e.g. "Watched"

  5. #5
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: ListBox with multiple table sources

    Sorry for the late reply.

    That's pretty much what I had, though basically trying something else now. I'll see what works best for me in the end.
    So simple put: Is it possible to have multiple tables fill in a ListBox?

    Kind regards,

    Marco

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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