+ Reply to Thread
Results 1 to 4 of 4

Loop find all matches of listbox items, display results in another listbox

  1. #1
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    198

    Loop find all matches of listbox items, display results in another listbox

    Okay here is what I have working so far:

    Listbox1 is populated by unique values from my data sheet.
    The values are attribute descriptions, and one description might occure up to 30 times depenging how many different
    values the attribute has.

    Now my user selects wanted attributes from listbox1 and they are moved by a button to listbox2.

    I got this part working like it should, the problem starts here.

    After a button2 is pressed do:

    Search for first value in listbox2, find all matches in column G. Display all values but from one column to the left (F) in listbox3
    continue to search all matches of value2 in listbox2

    I won't paste the whole code, I feel it is a bit unnecesery.

    Please Login or Register  to view this content.
    Last edited by banaanas; 07-29-2015 at 02:56 AM.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,383

    Re: Loop find all matches of listbox items, display results in another listbox

    Hi banaanas,

    Pretty hard to provide a solution without your workbook, but based on your existing code and comment If found how to populate listbox3 with values from column F?, try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

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

    Re: Loop find all matches of listbox items, display results in another listbox

    Try something like this...

    Please Login or Register  to view this content.
    This link may help explain how .Find works for multiple occurrences.
    The .Find Method
    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.

  4. #4
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    198

    Re: Loop find all matches of listbox items, display results in another listbox

    Quote Originally Posted by AlphaFrog View Post
    Try something like this...

    Please Login or Register  to view this content.
    This link may help explain how .Find works for multiple occurrences.
    The .Find Method
    Thank you a million times, with this I can move on Also thanks to Aplhafrog!

+ 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. Find and Display results VBA Code - Loop to find all Matches
    By i2rule in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2014, 03:14 PM
  2. For Loop to Add Items to a Listbox!!!
    By cory0789 in forum Excel Programming / VBA / Macros
    Replies: 55
    Last Post: 09-11-2014, 09:38 AM
  3. [SOLVED] Listbox items display briefly, then disappear?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 07-30-2013, 06:35 AM
  4. 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
  5. Editing listbox items in Dblclick event freezes Excel unless mouse moves over listbox
    By muneebmansoor in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-28-2013, 02:21 PM
  6. Transfer random listbox items to new listbox and then loop through selected items
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 05:58 PM
  7. [SOLVED] How to display Items in ListBox
    By sam in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-28-2006, 09:50 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