Remove lines from list box based on a desired specific keyword
Hello guys,
I would be very grateful as usual if you could help me on this one.
Lets say I have a Listbox containing the a number of items - say filepaths and so on. Now I would want to be able to loop through and remove specific lines/items from the list box based on the keyword I offer. Perhaps this should be in a form of a function or something so that
For example, if I want to remove all entries which has the word "#EXT" or a symbol, all such entries would be removed.
I would be very grateful for a practical demonstration.
Thanx.
Re: Remove lines from list box based on a desired specific keyword
A simple For:Next loop will work. But work in reverse from .ListCount-1 To 0 Step -1
For each list item within that loop, use InStr() on the .List(n) property to see if the criteria exists & if so, remove it.