Thursday, July 7, 2011

Creating Pivot Table :-

Sub Create_Pivot_Table_From_Cache()

Dim oPC As PivotCache
Dim oPT As PivotTable

Set oPC = ActiveWorkbook.PivotCaches.Create(xlDatabase, ActiveSheet.UsedRange)
Sheets.Add.Name = "Pivot"
oPT = oPC.CreatePivotTable(ActiveSheet.Range("A1"), "Pivot1", True)

End Sub

No comments: