+ Reply to Thread
Results 1 to 2 of 2

Dynamically Display RowSource Data in ListBox

  1. #1
    Registered User
    Join Date
    05-09-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Dynamically Display RowSource Data in ListBox

    In my workbook, Sheet1 contains all of the data I want to quantify. Column A contains a list of client names, and Column B contains a numerical value. There are additional columns from C to L with additional data.

    Column A can contain repeat client names on any given row, not necessarily grouped together (i.e. John Doe's name could appear in cell A2, A11, A25, etc). I'm creating a userform that contains a ComboBox (ComboBbox1), a ListBox (ListBox1), and a CommandButton (CommandButton1).

    The ComboBox is already working and alphabetically displays the unique values from Column A. Here's what's I need help with.... After the user selects a client name from the ComboBox and clicks the command button, I would like the ListBox to dynamically display only the records that match the ComboBox1.value. Also, if possible, I would also like these records to be sorted (ascending) by their numerical value contained in Column B.

    This is what my simple code looks like so far. The below codes currently pulls ALL records in my set (from A2:K100). I am not sure how to dynamcially change the RowSource to present the data in this ideal fashion.

    Please Login or Register  to view this content.
    I want the ListBox to display the all columns, A through K. But only the records that meet the specific criteria.

    Example:

    Client Name Numeric Value Extra Data 1 Extra Data 2 etc,...
    John Doe 13 ... ... ...
    Bobby Jo 45 ... ... ...
    John Doe 2 ... ... ...
    Carter Day 6 ... ... ...
    John Doe 40 ... ... ...

    UserForm ListBox result would be:

    Client Name Numeric Value Extra Data 1 Extra Data 2 etc,...
    John Doe 2 ... ... ...
    John Doe 13 ... ... ...
    John Doe 40 ... ... ...

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dynamically Display RowSource Data in ListBox

    Try this in your Userform Module:-
    Userfom1 Contains:- ListBox1 and Combobox1
    Please Login or Register  to view this content.
    Regards Mick

+ 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. [SOLVED] ListBox RowSource
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2013, 02:08 AM
  2. display content in excel sheet using listbox rowsource vba
    By tkfei in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2011, 05:45 AM
  3. [SOLVED] ???Help??? Userform.Listbox.rowsource = ???
    By Steve Sparti in forum Excel General
    Replies: 0
    Last Post: 03-01-2006, 05:50 PM
  4. Listbox - Rowsource
    By Paul W Smith in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2006, 05:30 PM
  5. [SOLVED] RowSource in ListBox
    By Noah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2005, 10:10 AM

Tags for this Thread

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