Afternoon
I am using a macro to filter several arguments.
Using 4 cells to define my filters. But if I leave any of them blank, the filter returns with no results.
How do I write the macro to ignore if the cell is left bank?
Thank you in advance.
I am using a macro to filter several arguments.
Using 4 cells to define my filters. But if I leave any of them blank, the filter returns with no results.
How do I write the macro to ignore if the cell is left bank?
Code:
Sub Filter()'
' Filter Macro
'
'
ActiveSheet.Range("$A$3:$FM$301").AutoFilter Field:=8, Criteria1:= _
Range("$D$2")
ActiveSheet.Range("$A$3:$FM$301").AutoFilter Field:=11, Criteria1:= _
Range("$E$2")
ActiveSheet.Range("$A$3:$FM$301").AutoFilter Field:=10, Criteria1:= _
Range("$F$2")
ActiveSheet.Range("$A$3:$FM$301").AutoFilter Field:=12, Criteria1:= _
Range("$G$2")
End Sub
Thank you in advance.