Hi,
I am using this VBA code to filter records.
Here is what i require:
If I enter (Tony, Smith) in cell D4 then the code should filter both records for tony & smith.
As of now the code only allows me to enter a single criteria in cells D4:F4
I would want the code to allow me to enter multiple criteria entered with a comma sign.
Any help would be appreciated
Regards,
Humayun
I am using this VBA code to filter records.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
With ActiveSheet.Range("D5:F1000")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="*" & Range("D4") & "*", visibledropdown:=False
.AutoFilter Field:=2, Criteria1:="*" & Range("E4") & "*", visibledropdown:=False
.AutoFilter Field:=3, Criteria1:="*" & Range("F4") & "*", visibledropdown:=False
End With
Application.ScreenUpdating = True
End Sub
Here is what i require:
If I enter (Tony, Smith) in cell D4 then the code should filter both records for tony & smith.
As of now the code only allows me to enter a single criteria in cells D4:F4
I would want the code to allow me to enter multiple criteria entered with a comma sign.
Any help would be appreciated
Regards,
Humayun