Hi everyone,
Can anyone tell me if it is even possible to use a dynamic range as an autofilter criteria? I tried with the below code and it does not work..a close variation also gets my Excel to crash
Dim var As Integer
Sheets("Master").Select
ActiveSheet.Cells(1, 1).CurrentRegion.Select
var = Selection.Rows.Count
Dim sir As Range
Set sir = Sheets("Master").Range(Cells(2, 1), Cells(var - 1, 1))
Sheets("Total Despatched").Select
ActiveSheet.Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$DI$2500").AutoFilter Field:=94, CriteriaRange:=sir, Operator:=xlFilterValues
What I am trying to do is identify the range in the Master tab and then using it to filter the Total Despatched tab for each entry in the range.
Any help would be much appreciated!
Thanks,
Alex
Can anyone tell me if it is even possible to use a dynamic range as an autofilter criteria? I tried with the below code and it does not work..a close variation also gets my Excel to crash
Dim var As Integer
Sheets("Master").Select
ActiveSheet.Cells(1, 1).CurrentRegion.Select
var = Selection.Rows.Count
Dim sir As Range
Set sir = Sheets("Master").Range(Cells(2, 1), Cells(var - 1, 1))
Sheets("Total Despatched").Select
ActiveSheet.Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$DI$2500").AutoFilter Field:=94, CriteriaRange:=sir, Operator:=xlFilterValues
What I am trying to do is identify the range in the Master tab and then using it to filter the Total Despatched tab for each entry in the range.
Any help would be much appreciated!
Thanks,
Alex