Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Pivottable Pivotselect string

I have a pivottable which I am attempting to format through VBA.

I use a table driven approach to loop through the fields in the pivot
table to format various things (borders, numberformat, bold, etc).

I want to be able to use the pivotslect method to be able to format the
fields, but I'm having little joy. Specifically, I have no problem
selecting the datafields and their labels, but it's the rowfield totals
which are killing me. Using the macrorecorder I have the following..

ActiveSheet.PivotTables("Tableau croisé dynamique5").PivotSelect _
"'Centre de Cout'[Tous;Somme]", xlDataAndLabel

I'm afraid it's in French (I'm using French excel). The problem with
the above is that it does not work when I try to apply it in a
procedure/ immediate window. Anyone have any thoughts?
I've been looking through the "standard pivottable report selection"
documentation and it tells me about spaces and use of single quotation
marks, but truth be told I was less clear after having read it.

In a perfect world I would like to have a function which converts the
field name and the mode into "standard pivottable report selection
format". Anyone have something that can help me out.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pivottable Pivotselect string

Hi,
You might consider something like this:

ActiveSheet.PivotTables("PivotTable2").Format xlReport6

xlReport6 is a constant associated with a table format
(Auto Format). Examples of the formats can be seen by
righ clicking anywhere in the Pivot table and looking at
format report. Using these special formats allows you to
flip the pivot table around without loosing the formating
you've done. So, you can pick any color scheme and
formatting you like and set the format with code then use
a bit more code to layout the pivot table as you like

Mike


-----Original Message-----
I have a pivottable which I am attempting to format

through VBA.

I use a table driven approach to loop through the fields

in the pivot
table to format various things (borders, numberformat,

bold, etc).

I want to be able to use the pivotslect method to be able

to format the
fields, but I'm having little joy. Specifically, I have

no problem
selecting the datafields and their labels, but it's the

rowfield totals
which are killing me. Using the macrorecorder I have the

following..

ActiveSheet.PivotTables("Tableau croisé

dynamique5").PivotSelect _
"'Centre de Cout'[Tous;Somme]", xlDataAndLabel

I'm afraid it's in French (I'm using French excel). The

problem with
the above is that it does not work when I try to apply it

in a
procedure/ immediate window. Anyone have any thoughts?
I've been looking through the "standard pivottable report

selection"
documentation and it tells me about spaces and use of

single quotation
marks, but truth be told I was less clear after having

read it.

In a perfect world I would like to have a function which

converts the
field name and the mode into "standard pivottable report

selection
format". Anyone have something that can help me out.

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Pivottable Pivotselect string

Mike

That's excellent. I'm really kicking myself that I've been wastng so
much time on formatting when there exists this property which will do
90% of the formatting that I require... and I'll never have to worry
about trying to get those standard pivot strings again.

Thanks again

Mohsen

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
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
How does one get the PivotTable report info that feeds another PivotTable report? Toby Erkson[_3_] Excel Programming 0 December 14th 04 10:00 PM
PivotTable - PivotTable Field name is not valid - error! miker1999[_17_] Excel Programming 1 June 10th 04 10:30 AM
PivotTable and connection string lc Excel Programming 1 November 6th 03 01:55 PM
PivotTable and connection string lc Excel Programming 0 November 5th 03 01:32 AM


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