Results 1 to 4 of 4

Thread: Comparing/Removing Data

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    Connecticut
    Posts
    7

    Comparing/Removing Data

    I have two listboxes that I need to compare. One contains some numbers between 1-11000; the second box contains all numbers 1-11000.

    What I'm trying to do is take a string from the first list and remove it from the second list.
    Code:
        Dim i As Short
        Dim x As Short
    
            For x = 0 To List2.Items.Count - 1
                For i = 0 To List1.Items.Count - 1
                    If List1.Items(i) = List2.Items(x) Then
                        List2.Items.Remove(x)
                    End If
                Next i
            Next x
    That is the code that I have, but it doesn't function right. I don't get any errors, but it also doesn't remove the numbers from list1.

    I forgot to add: If you couldn't tell, I'm a complete newb.
    Last edited by Vredig; Jul 26th, 2004 at 04:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width