Sub tcdmgh()
'
' tcdmgh Macro
' Macro recorded 16/06/2009 by bjonat
'
'
Range("A1:P5403").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"Source!R1C1:R5403C15").CreatePivotTable TableDestination:="", TableName:= _
"PivotTable2", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveWorkbook.ShowPivotTableFieldList = True
With ActiveSheet.PivotTables("PivotTable2").PivotFields("BaseCampaignSplit")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2").PivotFields("PolicyStatus")
.Orientation = xlRowField
.Position = 1
End With
Range("A4").Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("PolicyStatus")
.Orientation = xlColumnField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("PolicyStatus"), "Count of PolicyStatus", xlCount
ActiveWindow.SmallScroll Down:=15
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Reference2")
.Orientation = xlRowField
.Position = 1
End With
ActiveWorkbook.ShowPivotTableFieldList = False
Range("I20").Select
ActiveWindow.SmallScroll Down:=-33
End Sub