Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default AutoFilter Criteria using named range

Hi,

I tried to use named range as AutoFilter criteria but it fails to work
using codes below
In fact I need to filter column B in sheet1 under workbook A based on
range("A1:A10") in sheet5 of workbook B

Codes extract

With Workbooks("B.xls").Sheets(5)
..Range("A1", Range("A65536").End(xlUp)).Name = "MyRange"
End With
Workbooks("A.xls").activate
Sheets(1).Select
Selection.AutoFilter Field:=2, Criteria1:=MyRange,
Operator:=xlFilterValues

Any helps will be much appreciated and thanks in advance


Regards
Len


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default AutoFilter Criteria using named range

Autofilter does not take range as criteria.I have used Advanced
Filter.Hope this will solve

With Workbooks("B.xls").Sheets(5)
Range(.Range("A1"), .Range("A65536").End(xlUp)).Name = "MyRange"
End With
Workbooks("A.xls").Activate
Sheets(1).Select


If Selection Is Nothing Then
MsgBox "select ...."
Exit Sub
End If

Selection.AdvancedFilter Action:=xlFilterInPlace,
criteriarange:=Workbooks("B.xls").Worksheets(5).Ra nge("MyRange")
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
Autofilter using range from another sheet as the criteria Robert[_35_] Excel Programming 0 June 23rd 09 09:41 PM
Can I use a named range in the criteria for a sumif? rftmst Excel Worksheet Functions 2 September 1st 07 03:50 PM
named range with criteria. driller Excel Worksheet Functions 7 July 12th 07 11:04 PM
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet markx Excel Programming 1 November 24th 06 02:52 PM
Named Range Change Based On AutoFilter SanctifiedRock Excel Programming 3 May 16th 06 03:27 PM


All times are GMT +1. The time now is 12:21 AM.

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"