I have a spreadsheet with a table of parts in it. Above the table I have 3 data validation boxes that I want to automatically trigger filters on the table. I can get the first one to work fine but the other two I am having troubles with. The first one triggers it's own column filter. The other two work a filter on the same column. How can I get them all to run when the cell value in them is changed?
Here is the code:
Here is the code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Application.ScreenUpdating = False
ActiveSheet.ListObjects("Table32").Range.AutoFilter Field:=3, Criteria1:= _
Range("C8").Value, Operator:=xlAnd
Application.ScreenUpdating = True
ActiveSheet.Protect , AllowFiltering:=True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Application.ScreenUpdating = False
ActiveSheet.ListObjects("Table32").Range.AutoFilter Field:=4, Criteria1:= _
Range("C12").Value, Operator:=xlAnd
Application.ScreenUpdating = True
ActiveSheet.Protect , AllowFiltering:=True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Application.ScreenUpdating = False
ActiveSheet.ListObjects("Table32").Range.AutoFilter Field:=4, Criteria1:= _
Range("C12").Value, Operator:=xlOr, Criteria2:=Range("C16")
Application.ScreenUpdating = True
ActiveSheet.Protect , AllowFiltering:=True
End Sub