i am using a sheet event code to autofilter a range based on a cell value with support for regular expression
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "N1" '<== change to suit On Error Goto ws_exit Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then Me.Range("A1:C1").AutoFilter field:=3, Criteria1:=Target.Value End If ws_exit: Application.EnableEvents = True End Sub
this code will filter column c
based on criteria in cell n1
can this code be edited so that it will filter column d also based on cell value "o1"