Saperblue56
New Member
- Joined
- Aug 14, 2017
- Messages
- 9
Hello once again All,
well the Title says it all
Here my code:
It has Problems on the line :
vData = "'Anzahl_Kategorien_je_Kunde'!A1:H" & PVLastRow
also PVLastRow seams only to be =1 is this because the Pivot Table hasent been made yet ?
if Yes can someone help me to get round this.
All Help or Ideas Welcom
Ray
well the Title says it all
Here my code:
Code:
Sheets("Anzahl_Kategorien_je_Kunde").Select
Dim PvData As Range
Dim PVLastRow As Longt
PVLastRow = Range("A" & Rows.Count).End(xlUp).Row
PvData = "'Anzahl_Kategorien_je_Kunde'!A1:H" & PVLastRow
Cells(1, 1).Select
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range( _
PvData)
ActiveWorkbook.ShowPivotChartActiveFields = True
ActiveChart.ChartType = xlColumnClustered
With ActiveSheet.PivotTables("Kategorien_je_Kunde").PivotFields("Kunde")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("Kategorien_je_Kunde").PivotFields("SF")
.Orientation = xlRowField
.Position = 2
End With
ActiveSheet.PivotTables("Kategorien_je_Kunde1").AddDataField ActiveSheet.PivotTables( _
"Kategorien_je_Kunde").PivotFields("Häufigkeit"), "Summe von Häufigkeit", xlSum
With ActiveSheet.PivotTables("Kategorien_je_Kunde").PivotFields("Kategorie")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("Kategorien_je_Kunde").PivotFields("Erstellungs-Datum")
.Orientation = xlPageField
.Position = 2
End With
Range("B6").Select
With ActiveSheet.PivotTables("Kategorien_je_Kunde").PivotFields("Team")
.Orientation = xlPageField
.Position = 3
End With
It has Problems on the line :
vData = "'Anzahl_Kategorien_je_Kunde'!A1:H" & PVLastRow
also PVLastRow seams only to be =1 is this because the Pivot Table hasent been made yet ?
if Yes can someone help me to get round this.
All Help or Ideas Welcom
Ray