I'm trying to write a macro to autofilter two sheets in a workbook.
The first filter is based on a value in a dropdown list. Within the dropdown list, there are a series of 4 digit codes some of which begin with a zero (e.g. 0112, 4568, 9999, 0765, etc).
The second filter is in another sheet and it's simply trying to filter out all values that aren't zero.
Here's what I have so far but it's not working.....
Dim CostCentre As Integer CostCentre = Worksheets("Instructions").Range("A6").Value Sheets("Sheet1").Select ActiveSheet.Range("$A$1:$AS$5000").AutoFilter Field:=1, Criteria1:=CostCentre, _ Operator:=xlAnd Sheets("Sheet2").Select ActiveSheet.Range("$A$1:$AN$85").AutoFilter Field:=40, Criteria1:="<>0", Operator:= _ xlFilterValues End Sub