C
catrrmg
hi all
could someone give me a hand with this piece of code which I can't get to
work for me:
indPlan = Sheets("pivot").Range("L46").Value
Select Case indPlan
Case indPlan <= 3
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 4 & indPlan <= 6
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 7 & indPlan <= 9
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 10 & indPlan <= 12
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = True
End Select
thanks a lot in advance!
could someone give me a hand with this piece of code which I can't get to
work for me:
indPlan = Sheets("pivot").Range("L46").Value
Select Case indPlan
Case indPlan <= 3
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 4 & indPlan <= 6
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = False
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 7 & indPlan <= 9
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = False
Case indPlan >= 10 & indPlan <= 12
tptPlanMonths.PivotFields("quarter").PivotItems(1).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(2).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(3).Visible = True
tptPlanMonths.PivotFields("quarter").PivotItems(4).Visible = True
End Select
thanks a lot in advance!