Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot table giving an error

Hi All,

I am doin a macro that will be run weekly. I recorded a pivot table an
this is the code that i got from it but it giving me an error on th
line with *** beside it (something to do with "PivotTable7"???):


Sub PivotTable()
'
' PivotTable Macro
' Macro recorded 7/27/2004 by Cathal
'

'
Range("A5:P373").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"Sheet2!R5C1:R373C16").CreatePivotTable TableDestination:= _
"'[Copy of testda****again.xls]Agr types'!R2C1:R24C13", TableName:= _
"PivotTable7", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTables("PivotTable7").AddFields RowFields:=Array( _
*** "Assigned Agent", "Data"), ColumnFields:="Agreement Type"
With ActiveSheet.PivotTables("PivotTable7").PivotFields ("Num Days t
Close")
.Orientation = xlDataField
.Caption = "Average of Num Days to Close"
.Position = 1
.Function = xlAverage
End With
ActiveSheet.PivotTables("PivotTable7").PivotFields ("Cas
ID").Orientation = _
xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveWindow.SmallScroll Down:=15
Range("A1:N47").Select
Range("N47").Activate
Selection.NumberFormat = "0"
ActiveWindow.LargeScroll ToRight:=-1
ActiveSheet.PivotTables("PivotTable7").PivotSelect "", xlBlanks, True
Range("C8").Select
ActiveSheet.PivotTables("PivotTable7").RowGrand = False
End Sub



If any one could help me with this it would be great.

Thanks in advance.
Cathal

--
Message posted from http://www.ExcelForum.com

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
Any idea why this is giving me a #Value! Error? msnyc07 Excel Worksheet Functions 3 March 12th 10 05:22 PM
Giving me a error ( =REF! ) Steved Excel Worksheet Functions 2 October 5th 09 01:10 AM
Function giving error Martin Excel Discussion (Misc queries) 3 October 1st 05 12:58 PM
Function giving Error Martin Excel Worksheet Functions 3 October 1st 05 03:49 AM
How do I get a pivot table to sum instead of giving me a count? kmm Excel Worksheet Functions 1 November 5th 04 03:44 PM


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