Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
Filter for vb5 and up
Highlight all by clicking in box
Sub Filter(arr() As String, ByVal Search As String, Optional ByVal Include As Boolean, Optional ByVal CompareMethod As VbCompareMethod = vbBinaryCompare)
Dim index As Long
Dim count As Long
count = LBound(arr) - 1
For index = LBound(arr) To UBound(arr)
If (InStr(1, arr(index), Search, CompareMethod) > 0) = Include Then ' this item must be included
count = count + 1
If index <> count Then ' copy data only if necessary
arr(count) = arr(index)
Next ' trim items in excess
If count < UBound(arr) Then
ReDim Preserve arr(LBound(arr) To count) As String
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.