Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Help with autofilter and filtering a specific column

Hello Drew,

Try the following. Note that a space and underscore at the end of a line is
a line break in an otherwise single line of code.

With ActiveSheet.AutoFilter.Range

.AutoFilter Field:=1, Criteria1:="=3", _
Operator:=xlOr, Criteria2:="=4"

End With


--
Regards,

OssieMac

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is autofilter only filtering up to # of rows in prev column? Amanda Excel Discussion (Misc queries) 1 March 11th 09 02:36 PM
Autofilter Criteria not filtering when using NOW() bony_tony Excel Programming 16 August 26th 07 01:59 PM
Autofilter Not Filtering Properly Paputxi Excel Discussion (Misc queries) 1 May 3rd 06 06:29 PM
AutoFilter only filtering first 1000 Denise Robinson Excel Discussion (Misc queries) 2 March 21st 05 10:41 AM
Filtering out dates using autofilter sk8rider[_3_] Excel Programming 2 June 16th 04 09:43 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"