Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
[VBA] Hiding rows in PivotTable
Hi,
I have PivotTable in Excel 2003. In "Row Fields" there is dimension called [DepartmentEmployee] which consists of [Department] and [Employee] levels. To hide rows I used the following code: Sub Hide() Dim pt As PivotTable Dim pf As PivotField Dim pi As PivotItem Set pt = ActiveSheet.PivotTables(1) Application.ScreenUpdating = False Application.DisplayAlerts = False On Error Resume Next For Each pf In pt.RowFields For Each pi In pf.PivotItems pi.Visible = False Next pi Next pf Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub The problem is, that when the code is done there is no change in the layout of PivotTable.What went wrong? In this code "for" loops are iterated for Departments and Employees that are shown in the current layout of PivotTable. What should I do to make "for" loops iterate for all Departments and Employees (even the hidden ones). Thanks for any help. -- TM |
#2
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
[VBA] Hiding rows in PivotTable
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding rows when printing | Excel Discussion (Misc queries) | |||
Disabling hiding rows | Excel Discussion (Misc queries) | |||
resetting last cell | Excel Discussion (Misc queries) | |||
Hiding Rows Leaves Labels Blank | Excel Discussion (Misc queries) | |||
Hiding rows before printing | Excel Discussion (Misc queries) |