Microsoft Office Tutorials and References
In Depth Information
Figure 20-19. Selecting the company label and data for Boston
This also emphasizes a point we made earlier. Namely, we would like to rename the "Sum of
Sales" field to "Sales" but there is a column in the source table by that name, so Excel will not let
us use the name for a data field. Thus, we are stuck with "Sale." Now back to business.
The following code selects the entire pivot table:
ActiveSheet.PivotTables("Sales&Trans"). _
PivotSelect "", xlDataAndLabel
The following code selects the Store Type label area (pivot-field label and pivot-item labels):
ActiveSheet.PivotTables("Sales&Trans"). _
PivotSelect "'Store Type'[All]", xlLabelOnly
The following code selects all data and labels related to the Company pivot item:
ActiveSheet.PivotTables("Sales&Trans"). _
PivotSelect "Company", xlDataAndLabel
The following code selects the cells shown in Figure 20-19 :
ActiveSheet.PivotTables("Sales&Trans"). _
PivotSelect "Company BOSTON", xlDataAndLabel
Figure 20-19. Selecting the company label and data for Boston
On the other hand, by reversing the words Company and BOSTON:
ActiveSheet.PivotTables("Sales&Trans"). _
PivotSelect "BOSTON Company", xlDataAndLabel
we get the selection in Figure 20-20 , which does not include the Company label!
Figure 20-20. Reversing the word order to select company data for Boston only
 
 
 
 
Search JabSto ::




Custom Search