Hi
I have created a pivot table that creates the table to a new sheet.
How do i have the name of this sheet the same everytime the pivot table is created?
So the pivot table is always created to sheet called "Totals"?
Any ideas?
Below is my pivot table VBA
Sub CreatePivot()
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("Datasheet").Select
Range("A1").Select
Set objTable = ActiveSheet.PivotTableWizard
Set objField = objTable.PivotFields("Displayname")
objField.Orientation = xlRowField
Set objField = objTable.PivotFields("Description")
objField.Orientation = xlColumnField
Set objField = objTable.PivotFields("total")
objField.Orientation = xlDataField
End Sub
I have created a pivot table that creates the table to a new sheet.
How do i have the name of this sheet the same everytime the pivot table is created?
So the pivot table is always created to sheet called "Totals"?
Any ideas?
Below is my pivot table VBA
Sub CreatePivot()
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("Datasheet").Select
Range("A1").Select
Set objTable = ActiveSheet.PivotTableWizard
Set objField = objTable.PivotFields("Displayname")
objField.Orientation = xlRowField
Set objField = objTable.PivotFields("Description")
objField.Orientation = xlColumnField
Set objField = objTable.PivotFields("total")
objField.Orientation = xlDataField
End Sub