+ Reply to Thread
Results 1 to 4 of 4

Populating Listbox with autofilter result (should be unique)

  1. #1
    Registered User
    Join Date
    02-04-2016
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    18

    Populating Listbox with autofilter result (should be unique)

    below is my code. I have a userform which populates listbox1 on form.initialize event. Let's say I have 100 rows and filtered Column C and yielded 5 results. This means other rows are hidden right? Everything seems fine except that these codes also includes empty cells of the hidden rows. as well as duplicates. any fix for these 2 issues (blanks and duplicates). I just googled these codes so hopefully you can help me without changing all the given codes.
    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Populating Listbox with autofilter result (should be unique)

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-21-2017 at 05:17 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-04-2016
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    18

    Re: Populating Listbox with autofilter result (should be unique)

    Works perfectly! Thanks. Another question, what if i want to show 2 columns c and d (primary filter is still c) ? Which part of the code should i modify? Thanks!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Populating Listbox with autofilter result (should be unique)

    Please Login or Register  to view this content.

+ 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] Populating Multi-Column Listbox with Conditions from Another Listbox
    By ykobure in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2015, 02:28 AM
  2. User Form ListBox - Find Records (ListBox Populating Issue)
    By LONeillSSC in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-20-2015, 12:06 PM
  3. Populating a listbox or comobox (validation?) with unique values from large range
    By starfailure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2013, 11:41 PM
  4. Having problems populating a multicolumn listbox changing Listbox column with a loop.
    By Aristizabal95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2013, 12:41 PM
  5. Populating 1 listbox on the basis of another listbox selections
    By protocol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2011, 07:33 AM
  6. Populating listbox with unique values
    By protocol in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-17-2011, 08:44 AM
  7. Listbox of Unique Records populating another listbox
    By web2xs in forum Excel General
    Replies: 1
    Last Post: 04-16-2009, 11:27 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