AutoFilter with varying range

O177812

Board Regular
Joined
Apr 16, 2015
Messages
82
Office Version
  1. 365
  2. 2021
Hi I have the following already written an working:

Workbooks.Open Filename:= _
"P:\word documents\INW Group\SUPPLY & DEMAND\Demand Planner Data.xlsx"
ChDir "P:\word documents\INW Group\SUPPLY & DEMAND\Archive"
ActiveWorkbook.SaveAs Filename:= _
"P:\word documents\INW Group\SUPPLY & DEMAND\Archive\Demand Planner Data_" & Format(Date, "mm-dd-yyyy") & ".xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Columns("A").Find(what:="*", after:=cells(1, 1), LookIn:=xlFormulas).Activate
Selection.AutoFilter
ActiveSheet.Range("$A$25:$BP$64").AutoFilter Field:=4, Criteria1:=">0", _
Operator:=xlAnd

...
Unfortunately the data I am receiving is not consistent and the range that needs to be filtered is not always A25:B64. Is there a way to change this to fit my dilema.

Thanks!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,215,235
Messages
6,123,792
Members
449,126
Latest member
Greeshma Ravi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top