Hi
I need some help with the below sample code. Is it possible to use a variable as a case expression?
I have the following code that works.
Instead of using actual names in the case expression I want to use a variable:
instead of
I have been having no luck with an array variable. Is it at all possible?
Thanks!
I need some help with the below sample code. Is it possible to use a variable as a case expression?
I have the following code that works.
Code:
For Each PivItem In _
PT2.PivotFields("Brands").PivotItems
Select Case PivItem.Name
Case "Cola", "Pepsi", "7UP", "Fanta"
PivItem.Visible = True
Case Else
PivItem.Visible = False
End Select
Next PivItem
Instead of using actual names in the case expression I want to use a variable:
Code:
case BrandNames
Code:
Case "Cola", "Pepsi", "7UP", "Fanta"
I have been having no luck with an array variable. Is it at all possible?
Thanks!