Confused again

06-06-2005, 04:53 AM
I have listboxes which are arrayed


and i wish to remove the blanks from them however i found a piece code on the site and tried to modify it

For i = List(1).ListCount - 1 To 0 Step -1
If List(1).List(i) = " " Then
List(1).RemoveItem i
End If
Next i

but it doesnt seem to work :( any help would be appreciated :)

also while im here i will be looking to search the listboxes for a certain string and then take the data from other list boxes at the same position any help with that would be great too :)

06-06-2005, 05:18 AM
Are you sure it doesn't work? I just tested the code and it works fine. Are you sure you are supposed to be checking for a space " " instead of an empty string ""?

Searching a list box is not too hard. Just loop through all the elements from 0 to ListCount -1. Use List(1).List(i) to compare the current item with the one you're looking for. Once you've found it, break out of the loop and use the current value of i as the position where the element was found.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum