While the ChartObject is selected, you can go to the Immediate pane in the Visual Basic Editor and query the location with Print Selection.Top to learn that this ChartObject container is 75 points from the top of the spreadsheet.

Deselect the chart and reselect it by clicking between the chart boundary and the plot area. Now, the sizing handles appear black, indicating that you have selected the chart area inside the ChartObject. Note in Figure 10.2 that the Name box now includes the generic Chart Area name. The VBA code corresponding to this action would be

ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select

Figure 10.2

By simply clicking the chart,you get the black resize handles indicating that the Chart Area within the

ChartObject container is selected.The Name box would show that all charts have the sameChart Area name.

ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select

Microsoft Excel - CharLsSVBA.xls

Els Edit Sew Insert


Tools £hart Wintft

j 11 pg-q.^a j a i


0 0

Post a comment