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: 1
Default PivotTable Macro not working


This code doesnt work, SourceData:=.........
This section is the problem, many thks


Sub test()

x = Range("A50000").End(xlUp).Row
y = Range("IV1").End(xlToLeft).Column


Range("A1").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:
_
"Original!" & Cells(x, 1).Address & "," & Cells(1
y).Address).CreatePivotTable TableDestination:="", TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3
1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Cat4"
_
ColumnFields:="Account"

ActiveSheet.PivotTables("PivotTable1").PivotFields ("Amount").Orientatio
= _
xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.Name = "Check"
End Su

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56436

 
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
Excel 2007 PivotTable Report Filter area not working DaBus11 Excel Discussion (Misc queries) 0 July 27th 06 02:42 AM
pivottable name in a macro NEvans009 Excel Programming 2 April 11th 06 08:24 AM
excel2000 pivottable macro רוזנט Excel Programming 4 June 30th 05 05:02 PM
custom functions stop working in PivotTable in Excel2003 Mike Melnikov Excel Discussion (Misc queries) 0 February 10th 05 12:38 PM
PivotTable, Scenarios, Macro?? Dave Wilson New Users to Excel 4 December 18th 04 12:22 PM


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