![]() |
Question on Positioning Bar Chart Labels
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 |
Question on Positioning Bar Chart Labels
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 -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 02:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com