Are you saying that:
You have a spreadsheet that you wish to search.
You have a userform with several textboxes, and a listbox.
When the user makes entries in any of the textboxes,
you want the listbox to contain the records from the spreadsheet
that contain these values.
Does that sum it up?
You could use a change event for each of the textboxes.
Have the change event pass the value of the textbox to a
String_Search function. That way you're not duplicating the search
code. You can even pass the fieldname.
Say you have a textbox called TxtFirstName and TxtLastName.
You can then create the change events:
'--------------------------
Private Sub TxtFirstName_Change()
stat = Search_String("FirstName", txtFirstName.Text)
End Sub
Private Sub TxtLastName_Change()
stat = Search_String("LastName", txtLastName.Text)
End Sub
'------------------
then create the function:
'------------------------
Function Search_String(ByVal FieldName, ByVal FieldVal)
Select Case UCase(FieldName)
Case "FIRSTNAME"
' insert find code here.
' either update an array and return to change event
' to update the listbox,
' or update the listbox from here.
Case "LASTNAME"
Case "ADDRESS"
Case Else
End Select
End Function
If the user has values in multiple textboxes, do you want to search
for records that contain ALL the values?
That would be a little trickier, but could be done.
You could still use the change event, but if there is a value in the
listbox, search through those values instead of going back to the
original list.
Does this sound like it's leading down the path your heading?