Hi
I have the following code
'
Sheets.Add
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("name")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("age"), "Sum of age", xlSum
Range("E15").Select
End Sub
Instead of it saying PIVOT table 2 I need it to say active pivot (its the only pivot table on the sheet)
I have the following code
'
Sheets.Add
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("name")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("age"), "Sum of age", xlSum
Range("E15").Select
End Sub
Instead of it saying PIVOT table 2 I need it to say active pivot (its the only pivot table on the sheet)