View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Data Labels Macro

Kristin,
You needed another With statement so the labels would know
to which series they belonged.
The Position constant was incorrect.
AutoScaling belongs to the Labels not the Series.
'--
With ActiveChart.SeriesCollection(1)
.HasDataLabels = True
.ApplyDataLabels Type:=xlValue
With .DataLabels.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.ColorIndex = 2
End With
With .DataLabels
.AutoScaleFont = True
.Position = xlLabelPositionInsideBase
End With
End With
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Check out the Chart Data Labels add-in)



"Kristin"
wrote in message
I am writing a macro to create the chart from scratch and place the data
labels on the chart. The rest of the code works great. It hangs up where it
is supposed to add the data labels and do some formatting to the label. And
I am using XL 03.



"Jim Cone" wrote:
Kristin,
What are you trying to do?
Does the chart have data labels and you want to change something about them?
Are you trying to add data labels?
Something else?
What version of XL are you using?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)