MarkCBB
Active Member
- Joined
- Apr 12, 2010
- Messages
- 497
Hello VBA Pros,
I am trying to edit the below code so that if the filter Items do not = Month_Name and are not selected. i.e. If Month_name = March then March must be the only Month visible so I need to add <>Month_name then .visible = false, I havnt been able to figure out the correct way to writing this.
I am trying to edit the below code so that if the filter Items do not = Month_Name and are not selected. i.e. If Month_name = March then March must be the only Month visible so I need to add <>Month_name then .visible = false, I havnt been able to figure out the correct way to writing this.
Code:
Dim Month_Name As Range
Set Month_Name = Range("C7")
With Sheets("List").PivotTables("PivotTable2").PivotFields("MONTH")
.PivotItems(Month_Name.Value).Visible = True
End With
End With