+ Reply to Thread
Results 1 to 2 of 2

population list box without repeating information

  1. #1
    Registered User
    Join Date
    11-14-2004
    Location
    Georgia
    Posts
    57

    populating list box without repeating information

    ok, so i used the code below to fill a list box:

    Please Login or Register  to view this content.
    well, not exactly; the "oIngredient.Type = previoustype" needs to be replaced with something that will look through the array being filled and return true if it finds a duplicate.
    is there a way to do this?

    thanks ahead of time,
    sven
    Last edited by medicenpringles; 10-23-2005 at 10:17 PM.
    Brought to you by Pringles and his infinite genius. ~''~

    "Ctrl+Z is a beautiful thing."
    - Me.

  2. #2
    Tom Ogilvy
    Guest

    Re: population list box without repeating information

    See one method at John Walkenbach's site:

    http://www.j-walk.com/ss/excel/tips/tip47.htm
    Filling a ListBox With Unique Items
    --
    Regards,
    Tom Ogilvy

    "medicenpringles"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > ok, so i used the code below to fill a list box:
    >
    >
    > Code:
    > --------------------
    > Private Sub UserForm_Initialize()
    >
    > Dim oIngredient As Ingredient
    > Dim oIngredients As New Ingredients
    > Dim avIngredients() As Variant
    > Dim i As Integer
    >
    > For i = 1 To oIngredients.Count
    > Set oIngredient = oIngredients.Item(i)
    > avIngredients(i) = oIngredient.IngredientType
    > If oIngredient.Type = previoustype Then ' need something here
    > GoTo Skip
    > Else
    > Me.lstPreDefinedTypes.AddItem (CStr(oIngredient.IngredientType))
    > End If
    > Skip:
    > Next i
    >
    > End Sub
    > --------------------
    >
    >
    > well, not exactly; the "oIngredient.Type = previoustype" needs to be
    > replaced with something that will look through the array being filled
    > and return true if it finds a duplicate.
    > is there a way to do this?
    >
    > thanks ahead of time,
    > sven
    >
    >
    > --
    > medicenpringles
    >
    >
    > ------------------------------------------------------------------------
    > medicenpringles's Profile:

    http://www.excelforum.com/member.php...o&userid=16458
    > View this thread: http://www.excelforum.com/showthread...hreadid=478659
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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