Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofilter using range from another sheet as the criteria | Excel Programming | |||
Can I use a named range in the criteria for a sumif? | Excel Worksheet Functions | |||
named range with criteria. | Excel Worksheet Functions | |||
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet | Excel Programming | |||
Named Range Change Based On AutoFilter | Excel Programming |