View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mo_in_france mo_in_france is offline
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.