View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default delete selection in pivotcolumn

hi sybolt,

Sub Macro1()
Dim criteria, pi As PivotItem
criteria = Array("curyear", "prevyear", "budget")
Application.ScreenUpdating = False
With ActiveSheet.PivotTables(1).PivotFields(1)
.ClearAllFilters
For Each pi In .PivotItems
If Not IsError(Application.Match(pi, criteria, 0)) Then
pi.Visible = True
Else
pi.Visible = False
End If
Next
End With
Application.ScreenUpdating = True
End Sub

--
isabelle

--
isabelle


Le 2012-11-29 05:26, a écrit :
Of course the 'resume next' solves the problem, but i don't think this is very elegant.
so my question is: what is the easiest way to clear selections in a pivotfieldcolumn

any help is greatly appreciated

greets,

sybolt