View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ian M Ian M is offline
external usenet poster
 
Posts: 8
Default Pie charts in Macros

I have recorded a macro in Excel whereby I create a pie chart using
the Chart Wizard.

In Page 3 of the Chart Wizard, I click on the "Data Labels" tab.

Then I check the "Category Name" and "Value" boxes.

However, when I run the macro, the finished chart does not show either
Category Names or Values.

You will see from the code that it doesn't even show up.

Range("A4:B9").Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets("Test
Spreadsheet").Range("A4:B9"), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet,
Name:="Statistics"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = _
"Statistics"
End With
ActiveChart.HasLegend = False

Any ideas?

Kind regards

Ian M