Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Pivot Table Code - Simple Code Fix?

For an expert, this should be a simple fix.....

(at least I assume that it is....)

The following code works, but only for one or two pivot tables on the
worksheet. I have about 12 pivot tables on the same worksheet and I
need them all to refer to A1 for the source data.

What ammendments are needed?




Sub Test()

ActiveSheet.PivotTables(1).SourceData =
Application.ConvertFormula([a1], xlA1, xlR1C1)

End Sub




Thanx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Pivot Table Code - Simple Code Fix?

Keep in mind that this is just a shot in the dark...

Sub Test()
dim pvt as pivottable

for each pvt in activesheet.pivottalbles
pvt.SourceData = Application.ConvertFormula([a1], xlA1, xlR1C1)
next pvt
End Sub


--
HTH...

Jim Thomlinson


"J.W. Aldridge" wrote:

For an expert, this should be a simple fix.....

(at least I assume that it is....)

The following code works, but only for one or two pivot tables on the
worksheet. I have about 12 pivot tables on the same worksheet and I
need them all to refer to A1 for the source data.

What ammendments are needed?




Sub Test()

ActiveSheet.PivotTables(1).SourceData =
Application.ConvertFormula([a1], xlA1, xlR1C1)

End Sub




Thanx

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Pivot Table Code - Simple Code Fix?

tried it but.....

Error message: object doesnt support this property or method.


Any clues?
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
Code that will rerun or refresh a pivot table (after new data ispasted into the original Pivot Table's Source Range) Mike C[_5_] Excel Programming 3 February 15th 08 06:22 AM
Code for a Macro that allows a Pivot table to be repeatedly run (fora dynamic rows in a table, but static field names) Mike C[_5_] Excel Programming 1 February 11th 08 04:30 AM
Help with Pivot Table Code Please nospaminlich Excel Programming 2 November 10th 06 10:36 PM
VBA Code for a pivot table to open database and to reference table current page Pete Straman Straman via OfficeKB.com Excel Programming 0 February 21st 05 03:57 AM
HELP! Code for Pivot Table Sandy[_3_] Excel Programming 6 September 3rd 03 09:43 PM


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