+ Reply to Thread
Results 1 to 7 of 7

Populate Listbox From a range of cells AND comma separated values

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    113

    Populate Listbox From a range of cells AND comma separated values

    Quick question for all you awesome code writers who have been super helpful over the years.

    I'm trying to populate a listbox with unique values from a the cells in a single column and as well as comma separated values in those cells in that list.

    for example

    A1 = "dog, cat, mouse"
    A2 = "cat"
    A3 = "dog, mouse"
    A4 = blank

    listbox list:
    Cat
    Dog
    Mouse

    I know how to code for either scenario but not combined.

    Any help would be much appreciated

    Thanks,

    Code Flunkie
    Last edited by Code Flunkie; 11-10-2015 at 11:19 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Populate Listbox From a range of cells AND comma separated values

    Hello Code Flunkie,

    You will need to change the names of the ListBox , Worksheet, and the starting Range to match what you have.

    Copy this macro into the Declarations section of your UserForm.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Populate Listbox From a range of cells AND comma separated values

    How do I remove the duplicates from the listbox?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    20,051

    Re: Populate Listbox From a range of cells AND comma separated values

    See if this is how you wanted.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Populate Listbox From a range of cells AND comma separated values

    I'm Getting a run-time error automation error on this line. any suggestions?

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    20,051

    Re: Populate Listbox From a range of cells AND comma separated values

    Are you still on XP?
    Change to
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Populate Listbox From a range of cells AND comma separated values

    Windows 8.11 but it's a restricted work computer, Code works great. thanks for all the help/

+ 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. How to bring comma separated values present in a column into cells in next row?
    By Palraj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2014, 08:17 AM
  2. [SOLVED] Macro to match values in cells separated by semicolon and comma
    By Ale84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2013, 11:00 PM
  3. How to Separately put comma separated values in adjacent cells
    By en19ma in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2012, 01:30 AM
  4. Convert range of cells to comma separated list
    By maw230 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2012, 06:03 PM
  5. Replies: 3
    Last Post: 01-13-2012, 08:20 AM
  6. Re: summing comma separated values in a range
    By rjamison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 08:05 PM
  7. [SOLVED] summing comma separated values in a range
    By bthoron in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2005, 01:06 PM

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