Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Creating pivot table dynamically

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Creating pivot table dynamically

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" wrote in message
...
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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Creating pivot table dynamically

On May 20, 3:50*pm, "Patrick Molloy"
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" wrote in message

...



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
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
(repost) Dynamically creating pivot tables from page-field list klysell Excel Programming 9 July 10th 07 06:32 PM
Creating Pivot tables dynamically from page filter values summary klysell Excel Programming 0 July 9th 07 09:16 PM
Dynamically refreshing Pivot Table Range. Rob Excel Programming 3 June 8th 06 04:21 PM
Pivot Table Dynamically Creating on Query Brent[_7_] Excel Programming 2 June 7th 05 05:00 PM
Can we create pivot table dynamically priya Excel Programming 2 June 22nd 04 01:26 PM


All times are GMT +1. The time now is 08:54 AM.

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"