VBA to filter everything but current month dynamically

dshafique

Board Regular
Joined
Jun 19, 2017
Messages
171
Hi everyone trying to dynamically filter out items which are NOT the current month.
currently All i was able to come up with was:

VBA Code:
   ActiveSheet.ListObjects("TempMaster").Range.AutoFilter Field:=9, Criteria1:="<>" & xlFilterThisMonth, Operator:=xlFilterDynamic

but this doesnt seem to work.

any help would be greatly appreciated
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
If by:
filter out items which are NOT the current month
you mean that you only want to show the current month, then this should work:

VBA Code:
Sub Show_This_Month_Only()
    With ActiveSheet.ListObjects("TempMaster").Range
        .AutoFilter 9, 7, 11
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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