Macro/VBA - Filter selection by Date of current month and next month

tropiqz

New Member
Joined
Aug 28, 2018
Messages
10
Hi,

I have recorded a macro button which when pressed it currently filters the mm-mmm date in column 19 to 09-Sept or 10-Oct (current month and one month from now).

Sub Due()
'
' Due Macro
'


'
ActiveSheet.Range("$A$3:$V$190").AutoFilter Field:=19, Criteria1:="=09-Sep" _
, Operator:=xlOr, Criteria2:="=10-Oct"
End Sub

What i would like is instead of the current fixed dates, if the data could be filtered by the current month (0) and the next month (1) going by the date as if it was Today().

I cannot seem to get this work however, could someone kindly assist?

Thanks in advance!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Thanks for the response but this is still not working for me, it is just returning blanks and nothing on the filter. :(
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,973
Members
449,059
Latest member
oculus

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