View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Drew[_11_] Drew[_11_] is offline
external usenet poster
 
Posts: 1
Default Help with autofilter and filtering a specific column

in a macro that filters a specific column i have the following code...

ActiveSheet.Range("A7:CQ199").AutoFilter Field:=31, Criteria1:="=3",
_
Operator:=xlOr, Criteria2:="=4"

however, i have since given everything named ranges to make the table
more dynamic (so i dont have to modify my code everytime i add a
column or another row of data). so what i want to filter is column AE
(hence field 31). i named it ("AE7:AE199") "list"... but when i modify
the existing code to...

ActiveSheet.Range("list").AutoFilter Field:=1, Criteria1:="=3", _
Operator:=xlOr, Criteria2:="=4"

it does not work. how can i get this to work? any help is appreciated.