'### Разобрать сводные таблицы
Function FnDelFieldsAllSh() '(ByVal strShName As String)
On Error Resume Next
For Each oSh In ThisWorkbook.Sheets 'цикл по всем листам книги
If oSh.PivotTables.Count > 0 Then
Debug.Print oSh.Name & " ======================================="
For Each oPt In oSh.PivotTables 'цикл по всем сводным таблицам
Set Pt = oPt
With Pt
' ActiveSheet.PivotTables("СводнаяТаблица1").PivotFields("Месяц_Decl"). _
Orientation = xlHidden
For Each Pf In .PivotFields 'скинуть все поля
' dd = Pf.Orientation
' Debug.Print Pf & " ======= " & dd
Pf.Orientation = xlHidden
Next 'Pf
Set Pf = Nothing
End With
Next 'oPt
End If
Next 'oSh
End Function