Sarah52181
New Member
- Joined
- Mar 7, 2012
- Messages
- 19
Hello All,
I'd like to use an AutoFilter macro that references a certain cell as it's criteria. I realize the below code is nowhere near correct, but hopefully it helps to demonstrate what I'm trying to do. I have the criteria as an "Array" because cell C1 contains text along the lines of "January", "February", "July", (etc.) It concatenates the values of other cells based on which checkboxes a user selects. Hopefully the end result will be Excel auto-filtering based on the months the user has selected.
Is it possible to reference a cell's value in code?
Thanks for any help you can offer!
I'd like to use an AutoFilter macro that references a certain cell as it's criteria. I realize the below code is nowhere near correct, but hopefully it helps to demonstrate what I'm trying to do. I have the criteria as an "Array" because cell C1 contains text along the lines of "January", "February", "July", (etc.) It concatenates the values of other cells based on which checkboxes a user selects. Hopefully the end result will be Excel auto-filtering based on the months the user has selected.
Code:
Sub month_macro()
ActiveSheet.Range("A14:S300").AutoFilter Filed:=16, Criteria1:=Array("C1"), Operator:=xlFilterValues
End Sub
Is it possible to reference a cell's value in code?
Thanks for any help you can offer!