PC Review


Reply
Thread Tools Rate Thread

Creating pivot table dynamically

 
 
groupie
Guest
Posts: n/a
 
      20th May 2009
Hi,
I have a list of fields in a string and woudl liek to create a pivot
table from them, but am not sure how to proceed.
The fields are in a string with a , delimitor but I have also parsed
them into an array in case I could do it that way:

sPageFields = "field1, field2, field 3, field4"
Arr = SplitMultiDelims(sPageFields, ",") 'arr[0] = field1, arr
[1] = field2, etc...

' --> how to populate?::
oPT.AddFields RowFields:="Data", PageFields:=Array(" & Arr(iLoop)
& ")
or
oPT.AddFields RowFields:="Data", PageFields:=Array(" & sPageFields
& ")

Thanks!
 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      20th May 2009
I don't think you can do it that way, after all, a pivot table is based off
underlying data.

You need to put the data into a table first then assign the table to a
PivotCache and from the cache create the pivot table

"groupie" <(E-Mail Removed)> wrote in message
news:65857cb1-a5f5-40d4-8eb5-(E-Mail Removed)...
> Hi,
> I have a list of fields in a string and woudl liek to create a pivot
> table from them, but am not sure how to proceed.
> The fields are in a string with a , delimitor but I have also parsed
> them into an array in case I could do it that way:
>
> sPageFields = "field1, field2, field 3, field4"
> Arr = SplitMultiDelims(sPageFields, ",") 'arr[0] = field1, arr
> [1] = field2, etc...
>
> ' --> how to populate?::
> oPT.AddFields RowFields:="Data", PageFields:=Array(" & Arr(iLoop)
> & ")
> or
> oPT.AddFields RowFields:="Data", PageFields:=Array(" & sPageFields
> & ")
>
> Thanks!


 
Reply With Quote
 
groupie
Guest
Posts: n/a
 
      26th May 2009
On May 20, 3:50*pm, "Patrick Molloy" <patrick_mol...@hotmail.com>
wrote:
> I don't think you can do it that way, after all, a pivot table is based off
> underlying data.
>
> You need to put the data into a table first then assign the table to a
> PivotCache and from the cache create the pivot table
>
> "groupie" <justforgro...@gmail.com> wrote in message
>
> news:65857cb1-a5f5-40d4-8eb5-(E-Mail Removed)...
>
>
>
> > Hi,
> > I have a list of fields in a string and woudl liek to create a pivot
> > table from them, but am not sure how to proceed.
> > The fields are in a string with a , delimitor but I have also parsed
> > them into an array in case I could do it that way:

>
> > sPageFields = "field1, field2, field 3, field4"
> > * *Arr = SplitMultiDelims(sPageFields, ",") * *'arr[0] = field1, arr
> > [1] = field2, etc...

>
> > ' --> how to populate?::
> > * *oPT.AddFields RowFields:="Data", PageFields:=Array(" & Arr(iLoop)
> > & ")
> > or
> > * *oPT.AddFields RowFields:="Data", PageFields:=Array(" & sPageFields
> > & ")

>
> > Thanks!- Hide quoted text -

>
> - Show quoted text -


Hi,
Thanks for the reply.
Would you have an example of that? Don't see anything on Google.

Thanks,
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Pivot Table to Populate another table dynamically Chris Microsoft Excel Discussion 0 4th Nov 2008 10:39 PM
(repost) Dynamically creating pivot tables from page-field list =?Utf-8?B?a2x5c2VsbA==?= Microsoft Excel Programming 9 10th Jul 2007 06:32 PM
Creating Pivot tables dynamically from page filter values summary =?Utf-8?B?a2x5c2VsbA==?= Microsoft Excel Programming 0 9th Jul 2007 09:16 PM
dynamically/programatically creating Pivot Charts using Office Chart component iis hung Microsoft Access Database Table Design 0 15th Dec 2006 10:35 PM
Pivot Table Dynamically Creating on Query Brent Microsoft Excel Programming 2 7th Jun 2005 05:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:25 AM.