Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pivot Table problem

hi,

I want to programattically un select some of the items in
the child items of a dimension in pivot Table. So for this
I have written a query. But unselecting part, visible
property is not working.

Tried to update "pi.Visible" = False when even year =
2003 . But it is not updating. Seems like visible
property of pivot items is read only. Always the value is
true. When i checked microsoft site, its written visible
type is read/write boolean. where I am going wrong ?

Or Visible property of Pivot items will not work for OLAP
data source (my data source is poiting to analysis
Manager) ??

Thanks in advance for any help regarding this.

Sajith (code is below...)



Dim pf As PivotField
Dim pfmonth As PivotField
Dim pi As PivotItem
Dim Pimonth As PivotItem

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Set pf = ActiveSheet.PivotTables("PivotTable1") _
.PivotFields("[Week Date].[Week Date]")

Set pfmonth = ActiveSheet.PivotTables("PivotTable1") _
.PivotFields("[Week Date].[Month]")
Worksheets("Sheet2").PivotTables("PivotTable1") _
.PivotFields("[Week Date].[Week Date]").PivotItems
("22/09/2003").Visible = False


'For Each Pimonth In pfmonth.ChildItems
' If Pimonth.ChildItems = "01/01/2004" Then
' End If

'Next Pimonth
Application.ScreenUpdating = True
Application.DisplayAlerts = True

On Error Resume Next
With pf
.AutoSort xlManual, .SourceName
For Each pi In pf.PivotItems
If IsDate(pi.Caption) Then
If Year(CDate(pi.Caption)) = 2004 Then
pi.Visible = True

Else
pi.Visible = False

End If
End If
Next pi
.AutoSort xlAscending, .SourceName
End With
On Error GoTo 0

Application.DisplayAlerts = True
Application.ScreenUpdating = True
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem inserting calculated pivot fields into Pivot Table (2007) wamiller36 Excel Discussion (Misc queries) 1 March 5th 10 11:40 PM
Pivot Table in Excel 2007 : Problem with % in Table spudsnruf Excel Discussion (Misc queries) 2 January 9th 08 09:53 PM
Pivot table problem [email protected] Excel Worksheet Functions 1 April 19th 07 11:24 PM
Pivot table problem Ross Excel Discussion (Misc queries) 1 November 24th 05 05:07 PM
Pivot Table Problem jimicl Excel Discussion (Misc queries) 1 September 9th 05 06:56 PM


All times are GMT +1. The time now is 04:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"