Hi Papou,
Thanks for your reply. Sorry to say but I am not able to get your solution.
Following is the script of my recorded macro would be able to make necessary
amendment in the script so that this macro can be used to get pivot table
from other files as well:
Sub Pivot_Table_1()
'
' Pivot_Table_1 Macro
' Macro recorded 1/9/2008 by Mandeep
'
' Keyboard Shortcut: Ctrl+q
'
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"'Register'!R3C1:R65536C52").CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Dist Line
Type" _
, ColumnFields:="Invoice Source"
ActiveSheet.PivotTables("PivotTable1").PivotFields("Dist Line Type"). _
Orientation = xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Dist Line Type")
.PivotItems("(blank)").Visible = False
End With
End Sub