A
Adrian
Hi, Can anyone help me. I get this message when using the Macro's and I'm not
sure how to fix... Below is a snippet of code - The error occurs on the last
three lines of code... Any suggestions?
Thanks
Sheets.Add
Sheets.Add
Sheets("Sheet1").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R25000C37").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:= _
"StatusDescription"
ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription"). _
Orientation = xlDataField
With
ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription")
.PivotItems("(blank)").Visible = False
End With
Sheets("Sheet1").Select
ActiveWorkbook.Worksheets("Sheet4").PivotTables("PivotTable1").PivotCache. _
CreatePivotTable TableDestination:="", TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10
sure how to fix... Below is a snippet of code - The error occurs on the last
three lines of code... Any suggestions?
Thanks
Sheets.Add
Sheets.Add
Sheets("Sheet1").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R25000C37").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:= _
"StatusDescription"
ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription"). _
Orientation = xlDataField
With
ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription")
.PivotItems("(blank)").Visible = False
End With
Sheets("Sheet1").Select
ActiveWorkbook.Worksheets("Sheet4").PivotTables("PivotTable1").PivotCache. _
CreatePivotTable TableDestination:="", TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10