Question on Positioning Bar Chart Labels

  • Thread starter Thread starter michael way
  • Start date Start date
M

michael way

Hi,

I have dozens of similar bar charts, each with 8 bars. I would like to
place each bar's lable adjacent to its bottom if it's negative, or
adjacent to its top if it's positive. My problem is that when the data
changed the bar size will charge accrodingly, but the lables don't
move at all. I have to manually put them to the right places. Could
some one help me with some codes so that the lable will move with its
bar when the data change.

Thank you very much in advance.

Regards,
Michael
 
Hi micahel
try this

Sub position_labels()
For Each ss In ActiveChart.SeriesCollection
values_array = ss.Values
For n = 1 To ss.Points.Count
If values_array(n) < 0 Then ss.Points(n).DataLabel.Position
xlLabelPositionInsideBase Else ss.Points(n).DataLabel.Position
xlLabelPositionOutsideEnd
Next
Next
End Su
 
Back
Top