Anonymous321
New Member
- Joined
- Oct 12, 2021
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Hi.
I'm wondering if there is a way to set up a macro button that, once clicked, only filters the column that has the current date (the table headings are the months of the year). I know how to set it up so it filters a certain month (copy and pasted below). But it would be nice that, rather than me changing the macro code every month it automatically changes every month
Sub Free_Feb()
'
' Free_Feb Macro
'
'
ActiveSheet.Range("$E$3:$L$8").AutoFilter Field:=2, Criteria1:="Free"
End Sub
This is an example of the table I plan on filtering
I'm wondering if there is a way to set up a macro button that, once clicked, only filters the column that has the current date (the table headings are the months of the year). I know how to set it up so it filters a certain month (copy and pasted below). But it would be nice that, rather than me changing the macro code every month it automatically changes every month
Sub Free_Feb()
'
' Free_Feb Macro
'
'
ActiveSheet.Range("$E$3:$L$8").AutoFilter Field:=2, Criteria1:="Free"
End Sub
This is an example of the table I plan on filtering
Jan-21 | Feb-21 | Mar-21 | Apr-21 | May-21 | Jun-21 | Jul-21 | Aug-21 |
Free | Busy | Busy | Busy | Busy | Busy | Busy | Busy |
Free | Free | Free | Free | Free | Free | Busy | Busy |
Free | Busy | Busy | Busy | Busy | Busy | Busy | Busy |
Free | Busy | Busy | Busy | Busy | Busy | Busy | Busy |
Free | Free | Free | Free | Free | Free | Free | Free |