ActiveWorkbook. PivotCaches. Create (SourceType:=xlDatabase SourceData:=_
"BMW! R1C1: R1048576C2 ", Version:=xlPivotTableVersion15) CreatePivotTable _
TableDestination:="BMW! R1C7 ", TableName:="pivot table 1", DefaultVersion:=_
XlPivotTableVersion15
Sheets (" BMW "). Select
Cells (1, 7). Select
With ActiveSheet. PivotTables (" pivot table 1). PivotFields (" Summe ")
The Orientation=xlRowField
. The Position=1
End With
CodePudding user response:
ActiveWorkbook. PivotCaches. Create (SourceType:=xlDatabase SourceData:=_"BMW! R1C1: R 1048576 C2, "Version:=xlPivotTableVersion15) CreatePivotTable _
TableDestination:="BMW! R1C7 ", TableName:="pivot table 1", DefaultVersion:=_
XlPivotTableVersion15
Confirm that your original data, the number of rows if there are 1048576 so much, I doubt there is a pile of empty lines,
Also, you choose the data range of only two column C1 and C2, but why will appear behind the parameters of the C7,
Just from the code directly offer two suspected to check again, no practical validation, is not necessarily I said this two places,