Nochmal zu Pivotabelle
11.07.2003 14:22:13
Heike
ich hab es auf einen allgemeines Bespiel angepasst:
Pivot-Grundaten sind in: Tabelle1
Pivot-Tabelle selber in: Tabelle2
Die Mappe heißt: Mappe1
Der Bereich der jetzigen Pivotgrundaten ist A1:C15
PivotTablename: PivotTable1
Sub PivotBereich()
Dim intZeilen As Integer
Dim strSource As String
Dim wksPivotGrund As Worksheet
Dim wksPivotTabellen As Worksheet
Set wksPivotGrund = _
Workbooks("Mappe1.xls").Worksheets("Tabelle1")
Set wksPivotTabellen = _
Workbooks("Mappe1.xls").Worksheets("Tabelle2")
With wksPivotGrund
intZeilen = .Cells(.Rows.Count, 1).End(xlUp).Row
strSource = .Range(.Cells(1, 1), .Cells(intZeilen, 15)). _
Address(RowAbsolute:=True, ColumnAbsolute:=True, _
ReferenceStyle:=xlR1C1, External:=True)
End With
wksPivotTabellen.PivotTableWizard SourceType:=xlDatabase, _
SourceData:=strSource, _
TableDestination:=wksPivotTabellen.Range("A1"), _
TableName:="PivotTable1"
End Sub
Die letzten 4 Zeilen funktionieren immer noch nicht
Irgendwie kommich nicht drauf