'
' Pivot_Table Macro
'
'
Worksheets("Summary Sheet").Activate
Worksheets("Summary Sheet").Select
Range("A5").Select
ActiveWorksheets.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R5C1:R34665C4", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Summary Sheet!R5C1", TableName:="PivotTable1", _
DefaultVersion:=xlPivotTableVersion14
Sheets("Summary Sheet").Select
Cells(5, 1).Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields("DDDD")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("DDDDD1")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("DDDD111")
.Orientation = xlRowField
.Position = 3
End With
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Dialled_Number_Name"), _
"Count of Dialled_Number_Name", xlCount
With ActiveSheet.PivotTables("PivotTable1").PivotFields("DDDDD111")
.Orientation = xlColumnField
.Position = 1
End With
Bookmarks