Hello again
This is my second post trying to resolve this issue, hopefully I explain it better this time and can get some help.
I'm trying to filter on certain criteria for my pivot table and want to reference a particular set of cells.
Here is the code I got when I recorded my macro and manually filter:
Range("C1").Select
ActiveSheet.Range("$C$1:$D$28").AutoFilter Field:=1, Criteria1:=Array("1", _
"3", "YTD", "Z56"), Operator:=xlFilterValues
Instead of referencing "1" or "3", I'd like to reference the value in Cell A2 and A3 so that I can change the cell value and the pivot picks up the new value.
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Ref Cells[/TD]
[TD]Week[/TD]
[TD]Dollars[/TD]
[TD]State[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]10[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]10[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]Z56[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]YTD[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]4[/TD]
[TD]25[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]4[/TD]
[TD]25[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]YTD[/TD]
[TD]30[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]YTD[/TD]
[TD]30[/TD]
[TD]Co[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Z56[/TD]
[TD]100[/TD]
[TD]Co[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Z56[/TD]
[TD]100[/TD]
[TD]Co[/TD]
[/TR]
</TBODY>[/TABLE]
I'll keep working on it, but if someone could help point me in the right direction I'd be a very happy camper.
Thank you
Greg
This is my second post trying to resolve this issue, hopefully I explain it better this time and can get some help.
I'm trying to filter on certain criteria for my pivot table and want to reference a particular set of cells.
Here is the code I got when I recorded my macro and manually filter:
Range("C1").Select
ActiveSheet.Range("$C$1:$D$28").AutoFilter Field:=1, Criteria1:=Array("1", _
"3", "YTD", "Z56"), Operator:=xlFilterValues
Instead of referencing "1" or "3", I'd like to reference the value in Cell A2 and A3 so that I can change the cell value and the pivot picks up the new value.
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Ref Cells[/TD]
[TD]Week[/TD]
[TD]Dollars[/TD]
[TD]State[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]10[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]10[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]Z56[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD]YTD[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]Tx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]4[/TD]
[TD]25[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]4[/TD]
[TD]25[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]YTD[/TD]
[TD]30[/TD]
[TD]Ca[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]YTD[/TD]
[TD]30[/TD]
[TD]Co[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Z56[/TD]
[TD]100[/TD]
[TD]Co[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Z56[/TD]
[TD]100[/TD]
[TD]Co[/TD]
[/TR]
</TBODY>[/TABLE]
I'll keep working on it, but if someone could help point me in the right direction I'd be a very happy camper.
Thank you
Greg