Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default pivot table macro

I want to create a pivot table using the pivot table wizzard from a worksheet
into a worksheet with the name table by running a macro. when I record the
macro I create the pivot table using the wizzard and it works fine but when I
try to run the macro again it errors "unable to get the pivot tables property
of the worksheet class" any help?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,480
Default pivot table macro

Hi

Post the code you have created

--
Regards
Roger Govier

"skippy51" wrote in message
...
I want to create a pivot table using the pivot table wizzard from a
worksheet
into a worksheet with the name table by running a macro. when I record the
macro I create the pivot table using the wizzard and it works fine but
when I
try to run the macro again it errors "unable to get the pivot tables
property
of the worksheet class" any help?


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default pivot table macro

Sub pivottest1()
'
' pivottest1 Macro
' Macro recorded 5/11/2008 by Skip Bryczek
'

'
Sheets("temps").Select
Cells.Select
Selection.Clear
Range("A1").Select
Sheets("Temp_report").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"Temp_report!R1C1:R697C16").CreatePivotTable TableDestination:= _
"'[Scanner Readings test1.xls]temps'!R1C1",
TableName:="PivotTable1", _
DefaultVersion:=xlPivotTableVersion10
With ActiveSheet.PivotTables("PivotTable1")
.ColumnGrand = False
.PageFieldOrder = xlOverThenDown
.PageFieldWrapCount = 8
.RowGrand = False
End With
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Asset", _
ColumnFields:="Item"
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Reading")
.Orientation = xlDataField
.Caption = "Average of Reading"
.Function = xlAverage
End With
ActiveWorkbook.ShowPivotTableFieldList = False
End Sub


"Roger Govier" wrote:

Hi

Post the code you have created

--
Regards
Roger Govier

"skippy51" wrote in message
...
I want to create a pivot table using the pivot table wizzard from a
worksheet
into a worksheet with the name table by running a macro. when I record the
macro I create the pivot table using the wizzard and it works fine but
when I
try to run the macro again it errors "unable to get the pivot tables
property
of the worksheet class" any help?



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
Pivot Table from Macro Dave Excel Discussion (Misc queries) 2 November 15th 07 05:00 PM
Pivot Table by Macro? Roger Converse Charts and Charting in Excel 0 November 7th 07 09:56 PM
Is it possible to Macro a Pivot Table? jeannie v Excel Worksheet Functions 2 July 22nd 07 01:56 AM
Pivot Table Macro BCNU Excel Discussion (Misc queries) 0 November 14th 06 01:33 AM
MACRO FOR PIVOT TABLE anu Excel Discussion (Misc queries) 2 August 11th 06 05:07 PM


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