Kemidan2014
Board Regular
- Joined
- Apr 4, 2022
- Messages
- 229
- Office Version
- 365
- Platform
- Windows
Playing around with Macro recorder I got this code string because i need to use data by year and as time passes the year we want to look at will change
I know i need to clean this up but for now what could i do so this code to where i can for example highlight a cell for the user to type in the year and then the macro runs so that the sheet i am referencing will filter by that year?
i feel like theres a cell reference i need but not sure how to key it or where to put it with in the code
VBA Code:
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$Z$1046").AutoFilter Field:=15, Operator:= _
xlFilterValues, Criteria2:=Array(0, "4/19/2022")
I know i need to clean this up but for now what could i do so this code to where i can for example highlight a cell for the user to type in the year and then the macro runs so that the sheet i am referencing will filter by that year?
i feel like theres a cell reference i need but not sure how to key it or where to put it with in the code