LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Pivot Table Creation

I'm having trouble programatically creating a pivot table. If I step through
the code below it works, but if I run it, it falls over on the Set PT line.
Can anyone see a problem with my code?
Thanks
Rob

Sub MakePivot(ReportName As String, DataAddress As String, ReportAddress As
Range)

Dim PTcache As PivotCache
Dim PT

Set PTcache = ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:=DataAddress)
Set PT = PTcache.CreatePivotTable(TableDestination:=ReportA ddress,
TableName:=ReportName)

 
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
Pivot table creation from another pivot table in 2007 Roger Excel Discussion (Misc queries) 0 August 4th 09 10:52 PM
Pivot table creation in excel NRCan13 Excel Worksheet Functions 1 October 1st 08 02:07 PM
pivot table creation procedures PIVOT TABLE Excel Discussion (Misc queries) 1 July 2nd 08 08:40 AM
Pivot table creation error VBA XLS Willow[_5_] Excel Programming 7 March 10th 05 06:49 AM
Arranging data for Pivot table creation????? jacef Excel Programming 1 September 20th 04 08:49 PM


All times are GMT +1. The time now is 07:09 PM.

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"