+ Reply to Thread
Results 1 to 7 of 7

Multicolumn Listbox - How to remove duplicates and sort by first column?

  1. #1
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Multicolumn Listbox - How to remove duplicates and sort by first column?

    All,

    I am trying to figure out how to remove the duplicates in my listbox. Here is my code to pull data into the listbox. However, I noticed that if someone partially paid an invoice and made two payments to one invoice, the listbox will show the invoice twice with the same balance. Is there a way to remove the duplicates from the listbox? Also, is there a way to sort the listbox starting with the 1st column?

    Please Login or Register  to view this content.
    Thank you in advance for your help.

    J
    Last edited by s2jrchoi; 12-13-2013 at 03:18 PM.

  2. #2
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    It appears there are many posts about removing duplicates in single column listboxes but I can't find any that relates to multicolumn listboxes. Can anyone please help?

    Thank you!

  3. #3
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    Can someone please help me with the code? It picks up duplicates and I don't know how I can get it to not pick up duplicates. Any suggestions will be greatly appreciated. Thank you!

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    Hi s2jrchoi,
    could you attach an example of your file

  5. #5
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    you could try this

    http://spreadsheetpage.com/index.php..._unique_items/

    it adds each value to a collection(Array) if the value alreay exists it causes an error and then moves onto add the next value

    i can only suggest you create another collection for the 2nd value or add them to a new list on a sheet based on if the first value is added to the collection.

    hope it helps, cant try it out myself as just about to finish.

    good luck
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  6. #6
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    Hi nilem,

    This is the best I can do. I created a sample workbook with sample data. Please take a look. Sometimes we send out invoices with negative invoice amounts and because of this, the invoice shows up twice when it should only show up once. Please let me know if you have any questions. I will try my best to answer them.

    Thank you again for your help!!!!!
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multicolumn Listbox - How to remove duplicates and sort by first column?

    Thanks Sean. I will take a look at this and see if I can incorporate them in my workbook. Thank you again!

+ 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] Sort for multicolumn listbox in userform (5-columns)
    By d.sanchez in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-11-2017, 05:30 AM
  2. 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
  3. Copy Selected items from multicolumn, multiselect listbox to another listbox
    By Willigb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 11:27 AM
  4. Doubleclick in a multicolumn listbox and get the column index?
    By peter233 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2008, 06:31 AM
  5. [SOLVED] Sort multicolumn listbox items?
    By Jens Meier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2005, 11:05 AM

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