T
T De Villiers
When I run the following I obtain message "named argument not found"
I think the problem arises on :
DefaultVersion:=xlPivotTableVersion10
MAny thanks
Sub test()
x = Range("A50000").End(xlUp).Row
y = Range("IV1").End(xlToLeft).Column
Range("A1").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, 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 Sub
DefaultVersion:=xlPivotTableVersion1
I think the problem arises on :
DefaultVersion:=xlPivotTableVersion10
MAny thanks
Sub test()
x = Range("A50000").End(xlUp).Row
y = Range("IV1").End(xlToLeft).Column
Range("A1").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, 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 Sub
DefaultVersion:=xlPivotTableVersion1