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

As the last step in a series of macros, I created three pivot tables to
summarize my data. The macros were recorded. When I run the macros, I get
the error:

Run-time error '1004':

Application-defined or object-defined error


When I go to the debugger, the instruction:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'12-21-2003'!R1C1:R90C12").CreatePivotTable TableDestination:= _
"'[Production.xls]12-21-2003'!R2C23", TableName:="PivotTable3", _
DefaultVersion:=xlPivotTableVersion10

is highlighted. I assume the problem is that when I recorded the macro the
active sheet was named "12-21-03", and the data was in the range
R1C1:R90C12. However, that is not the name of the sheet now, and the number
of rows in the data range will vary.

If this is indeed the problem, could someone give me the syntax to change
this instruction to refer to the current active sheet and the current active
range (it won't necessarliy be R1C1:R90C12) of my data. (the data I want for
the pivot table will always start at R1C1, but will end at RxC12 where x is
the number or rows, which will be different each time I run this).

The name of the workbook will always be Production.xls.

If there are other problems besides these references, any hint of where to
go to solve them would be appreciated.

Again, thanks in advance.


 
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 Question Me Excel Worksheet Functions 1 April 27th 07 01:41 AM
Pivot table question gary Excel Discussion (Misc queries) 1 January 10th 06 06:25 PM
Pivot Table Question : If statment in Pivot Table?? seve Excel Discussion (Misc queries) 2 November 22nd 05 01:00 AM
Pivot Table Question Jennifer Excel Discussion (Misc queries) 1 July 13th 05 12:27 PM
Pivot Table Question Dave Peterson[_3_] Excel Programming 0 September 8th 03 09:44 PM


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