Microsoft Office Tutorials and References
In Depth Information
Step-by-Step
figurE 15-22
step-by-step
1.
Activate the worksheet that contains the source data list and PivotTable.
2.
Press Alt+F11 to go to the Visual Basic Editor.
3.
From the menu bar, click Insert Module.
4.
In the new module, enter Sub CreatePivotChart and press the Enter key. VBA will produce
the following lines of code for you:
Sub CreatePivotChart()
End Sub
5.
Turn off ScreenUpdating to help your macro run faster by not refreshing the screen as objects
in the code are created and manipulated.
Application.ScreenUpdating = False
6.
Declare an Object variable for the existing PivotTable:
Dim objPT As PivotTable
Search JabSto ::




Custom Search