no on the 97
code follows ...
Rows("1:2").Select
Selection.Delete Shift:=xlUp
Cells.Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"ffcnyipm!C1:C13").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1"
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").SmallGrid = False
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:=Array( _
"Group number and name", "PCP"), ColumnFields:="Zip code"
ActiveSheet.PivotTables("PivotTable1").PivotFields("PCP").Orientation = _
xlDataField
ActiveSheet.PivotTables("PivotTable1").PivotSelect "", xlDataAndLabel
Range("B5").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Group number
and name" _
)
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Zip code")
.PivotItems(" ").Visible = False
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("PCP")
.PivotItems("(blank)").Visible = False
End With
ChDir "E:\adhoc_team\jnewland\erfreqflyer\March's data"
ActiveWorkbook.SaveAs Filename:= _
"E:\adhoc_team\jnewland\erfreqflyer\March's data\ffcnyipm.xls",
FileFormat:= _
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
fails at line 10 and 11
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:=Array( _
"Group number and name", "PCP"), ColumnFields:="Zip code"