Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
shouldn't this be
"Original!" & Cells(x, 1).Address & ":" & Cells(1, y).Address with a colon instead of a comma? and your going from the last row in column A to the first row in column Y - Legal - just making sure that is what you want. -- Regards, Tom Ogilvy "T De Villiers" wrote: 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").Orientation = _ xlDataField ActiveWorkbook.ShowPivotTableFieldList = True ActiveSheet.Name = "Check" End Sub -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=564363 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Tom, always helpfu -- 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 PivotTable Report Filter area not working | Excel Discussion (Misc queries) | |||
pivottable name in a macro | Excel Programming | |||
excel2000 pivottable macro | Excel Programming | |||
custom functions stop working in PivotTable in Excel2003 | Excel Discussion (Misc queries) | |||
PivotTable, Scenarios, Macro?? | New Users to Excel |