Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Macro for Pivot in MS Excel 2003 vs 2007

Hi,

I have the following macro that clears all filters in a pivot table of mine
in 2007:

Sheets(2).PivotTables("PivotTable1").ClearAllFilte rs.

When I try to run the macro in 2003 I get an error message that says:
"Object doesn't support the property or method."

Any ideas for how I can clear all filters in my pivot table in excel 2003
using a macro.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Macro for Pivot in MS Excel 2003 vs 2007

'=========================
Sub PivotShowItemResetSort()
'show all items in field
'sort is set to Manual to prevent errors, e.g.
'unable to set Visible Property of PivotItem class
'returns sort order to previous setting
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim intASO As Integer

Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
For Each pt In ActiveSheet.PivotTables
pt.ManualUpdate = True
For Each pf In pt.VisibleFields
intASO = pf.AutoSortOrder
pf.AutoSort xlManual, pf.SourceName
For Each pi In pf.PivotItems
pi.Visible = True
Next pi
pf.AutoSort intASO, pf.SourceName
pf.CurrentPage = "(All)"
Next pf
pt.ManualUpdate = False
Next pt
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
'=========================

MichaelR wrote:
Hi,

I have the following macro that clears all filters in a pivot table of mine
in 2007:

Sheets(2).PivotTables("PivotTable1").ClearAllFilte rs.

When I try to run the macro in 2003 I get an error message that says:
"Object doesn't support the property or method."

Any ideas for how I can clear all filters in my pivot table in excel 2003
using a macro.

Thanks.



--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Blog: http://blog.contextures.com

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
Pivot tables in Excel 2003 and 2007 bakang Excel Discussion (Misc queries) 0 June 26th 08 08:01 AM
how do I refresh in excel 2007 a 2003 pivot table? tavi Excel Discussion (Misc queries) 0 June 18th 08 11:15 AM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
Excel 2007 pivot table formats that work with 2003 Steven Excel Discussion (Misc queries) 1 March 22nd 08 12:44 AM
SOS!!! Excel 2007 - Pivot tables created in 2003 format Tina Excel Discussion (Misc queries) 0 August 20th 07 11:20 PM


All times are GMT +1. The time now is 04:24 PM.

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

About Us

"It's about Microsoft Excel"