Hi all,

I'm running into a problem when I tried to set the value of pivot field (eg. Segment). It works fine when the input SEG exists in the drop down menu. However, I can't seem to get it to choose (blank) if SEG not found.

Any comments or ideas are welcomed. Thanks in advance!



If ActiveSheet.PivotTables("PivotTable1").PivotFields("Segment").Value! = SEG Then
ActiveSheet.PivotTables("PivotTable1").PivotFields("Segment"). _
CurrentPage = "(blank)"
Else
ActiveSheet.PivotTables("PivotTable1").PivotFields("Segment"). _
CurrentPage = SEG
End If