Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot Table - Filtering on a user defined field

Hi,

I have a VBA form in excel that allows users to select which field in a
Pivot Table to display. The selection that the user makes is a field called
'Select_Report'.

My code (below) then allows the Pivot Table to filter on a Pivotfield called
'Alias' and whatever field the user selected in 'Select_Report' - this works
fine:

ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:=Array( _
Select_Report, "Alias")

Problem - I need to be able to sort the values in the resulting
'Select_Report' field but this does not seem to work - I've tried adding this
line to achieve this:

With ActiveSheet.PivotTables("PivotTable1").PivotFields (Select_Report)
.PivotItems("FALSE").Visible = False
End With

I get an error message saying: "Run time error 1004 - Unable to get the
Pivotfields property of the PivotTable class"

I think the problem is that it doesn't recgonise 'Select_Report' as a
PivotField (even though it's value is still set to whatever the user
selected, which is a valid field in my Pivot Table)!

I really need a way of sorting the 'Select_Report' field (it will only ever
contain TRUE or FALSE).

Please help if you can - much much appreciated. Brad
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 table page field filtering murkaboris Excel Discussion (Misc queries) 2 December 19th 08 01:47 AM
Auto filtering pivot table field Karim Excel Programming 3 July 9th 07 02:12 PM
Pivot Table - Filtering Data Field Mark Excel Discussion (Misc queries) 3 May 29th 07 05:16 PM
pivot table calculated field with user function puff Excel Programming 2 January 24th 06 09:57 PM
Pivot Table - Filtering Page Field R. G. Ingersoll Excel Discussion (Misc queries) 1 January 29th 05 07:29 PM


All times are GMT +1. The time now is 10:00 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"