Mixing Advanced Filters and Normal Filters

gress032

New Member
Joined
Aug 21, 2019
Messages
4
Good afternoon!

So I am trying to sat up an automatic report for my job where I can use advance filters to type the selected months into the criteria page and have it filter per those months. The macro however uses both Advanced and Normal filters and when I transition between, the entire table is reset and I lose the advanced filter. The code is below with the annotation at spot where things start to go screwy.

Sub MonthSelectExternal()
'
' MonthSelectExternal Macro
' This runs the month(s) of your choice. Saved in an external workbook to increase processing speed. Will change later.
'
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

ActiveSheet.ShowAllData
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Range("Table2[#All]").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange _
:=Sheets("MonthSelect").Range("A1:M4"), Unique:=False

Sheets("Sheet2").Select
Cells.Select
Selection.ClearContents
Sheets("Report Generation").Select
'Below is where the filters revert back and make the advance filter inactive.
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=4, Criteria1:= _
"ST"
Range("Table2[[#Headers],[Order Type]]").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Select

Any ideas on how to keep the advance filter settings would be greatly Helpful!!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi there and welcome. I suggest you add the ordinary filter criteria into the advanced filter.
 
Upvote 0
Hi there and welcome. I suggest you add the ordinary filter criteria into the advanced filter.

Hi! Thank you for your response. I am relatively new to the VBA world and was wondering how I might place an ordinary filter criteria into the advance filter setting?
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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