excel vba 2010
What I have:
I have a textbox33 I'm allowing people to type in a search term to see if it exists in 2 columns in the listbox.(terms SEPERATED BY A ;
So a textbox33 could contain
strFilter = Split(TextBox33.Text, ";")
For lngIndex = ListBox32.ListCount - 1 To 0 Step -1
bFound = True
For lngPart = 0 To UBound(strFilter) ' VALUES TO SEARCH FOR
' assuming bfound is still true
If InStr(1, UCase(ListBox32.List(lngIndex, 3)), UCase(strFilter(lngPart))) = 0 Or InStr(1, UCase(ListBox32.List(lngIndex, 4)), UCase(strFilter(lngPart))) = 0 Then
bFound = False
If Not bFound Then
What I need:
if a person types in more than 1 search term. The code becomes more complicated.
Basically, I need this.
All 3 search terms has to exist in both columns.
right now i'm using an OR
so in this case "RED;10;WOOD;" would have to exist in both columns in all rows.
if any of the terms do not exist in either column.
that row gets deleted from the listbox.
it may be as simple as changing the operator to an "AND" ??
just trying to make sure.