Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Pivot Table Page Fields ~ Filtering for multiple values

Hello..

I've been working on a bit of code that genrates a number of Pivot Tables
for my bosses based on a large raw data spreadsheet. So far I have the macro
working like a charm, but now I'm trying to get fancy (or maybe just simplify
the code a bit).

One segment of the code generates a PT with this layout:

' Set a Pivot Table variable to our new Pivot Table
Set PSPT = ActiveSheet.PivotTables("PSPivot")


' Set the layout of the Pivot Table
PSPT.AddFields RowFields:=Array("Forecast Status Description-Current",
"Country Name"), _
ColumnFields:="Booked Month", PageFields:=Array("Year", "PSCol")
PSPT.PivotFields("Forecast Status
Description-Current").PivotItems("UPSIDE").Position = 2
PSPT.PivotFields("Year").CurrentPage = "2009"
PSPT.PivotFields("PSCol").CurrentPage = "PS"
PSPT.NullString = "0"
Cells.EntireColumn.AutoFit
ActiveWorkbook.ShowPivotTableFieldList = False

The Page Field "PSCol" comes from a column created at a previous step in the
macro. This Column takes the values (text) from another column in the raw
data and calculates this formula: =Left(rawdatacell, 2)

The information in the raw data column looks like this (There are over 1000
different descriptions):

PS Application Development
PS Business Consulting
PS Customer Education
PS Deployment
PS Implementation
PS Integration
PS IT Consulting
PS Project Management
PS Software Maintenance & Sup
SCER
Specialty Media
SW- INTERNATIONAL DOCUMENT ENT
SW- NCR AIRLINE MOBILE WEB
SW- NCR HOTEL CHECK-IN

The reason I created the PSCol with that formula in it is so that I can then
filter in the Pivot Table with the expression:

PSPT.PivotFields("PSCol").CurrentPage = "PS"

My question is:
Is there a way where I could avoid creating that PSCol and use the raw data
column instead? I would need to filter that page field to only show the
following descriptions:
PS Application Development
PS Business Consulting
PS Customer Education
PS Deployment
PS Implementation
PS Integration
PS IT Consulting
PS Project Management
PS Software Maintenance & Sup

Being that they all start with PS, I thought there could be a way of using
the Like operator, but nothing I try works.

Any help would be appreciated.

juan correa
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 - Multiple Page Fields - AND/OR Logic Choice? what_the_excel Excel Discussion (Misc queries) 1 March 10th 09 11:26 AM
Use multiple page fields in pivot table Pair_of_Scissors[_2_] Excel Worksheet Functions 7 October 20th 08 07:01 PM
Macro on filtering pivot table (pivot fields) = debug markx Excel Programming 2 May 28th 08 09:32 AM
Pivot table page fields add values previously deslected Robin Excel Discussion (Misc queries) 1 May 31st 06 02:47 PM
Filtering or linking Page Fields in an Excel Pivot Table Nick Weekes Excel Programming 0 April 27th 04 02:20 PM


All times are GMT +1. The time now is 07:16 PM.

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"