Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following script:
For i = 1 To ActiveWorkbook.Sheets().Count Sheets(i).Select For j = 1 To ActiveSheet.PivotTables().Count ActiveSheet.PivotTables(j).PivotSelect "", xlOrigin ActiveSheet.PivotTables(j).RefreshTable ActiveSheet.PivotTables(j).PivotFields("Year").Cur rentPage = CurrYear With ActiveSheet.PivotTables(j).PivotFields("YearMonth" ) For k = 1 To .PivotItems.Count If Val(.PivotItems(k)) <= Currmonth Then If .PivotItems(k).Visible = False Then .PivotItems(k).Visible = True End If Else If .PivotItems(k).Visible = True Then .PivotItems(k).Visible = False End If End If Next 'k End With Range("A1").Select Next 'j Next 'i I sometimes receive the error RuntimeError: 1004 Unable to set the visibility Property of the PivotItems Class. What can be the cause, how can it be solved? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
userforms showing and hiding | Excel Programming | |||
hiding and showing graphs | Excel Worksheet Functions | |||
showing hidden items of a pivot table in a cell | Excel Programming | |||
Showing and hiding columns | Excel Programming | |||
hiding showing columns using checkboxes | Excel Programming |