rjacmuto32
Member
I'm able to update a pivot table I have with VB code based on a value I put into my field. I'm using this code. It makes me able to change the filter on my name field.
ActiveSheet.PivotTables("PivotTable2").PivotFields("Name").PivotFilters _
.Add Type:=xlCaptionEquals, Value1:= "In-Progess"
My problem is I have to put in a code for what I want to filter at the end. If I want it to filter for Not Started, i have to change the code at the end to be = "Not Started" I have several different names I do that for depending on what someone selects from a cell.
Can I do this with a Defined Name Field?
For instance in cell L1 I have a formula that shows me my NAme of In-Progress, Not-Started, On Hold etc. That field I defined as MutoSelect. Since my field is now named how can I change the code above to filter on that defined named field?
ActiveSheet.PivotTables("PivotTable2").PivotFields("Name").PivotFilters _
.Add Type:=xlCaptionEquals, Value1:= "In-Progess"
My problem is I have to put in a code for what I want to filter at the end. If I want it to filter for Not Started, i have to change the code at the end to be = "Not Started" I have several different names I do that for depending on what someone selects from a cell.
Can I do this with a Defined Name Field?
For instance in cell L1 I have a formula that shows me my NAme of In-Progress, Not-Started, On Hold etc. That field I defined as MutoSelect. Since my field is now named how can I change the code above to filter on that defined named field?