Cell reference for chart point

New to excel vba.. I am trying to reference a cell value for a chart point and I get an error at this line:

ActiveChart.SeriesCollection(1).Points(Sheets("Sheet1"), Range("C1")).ApplyDataLabels

Any help is appreciated

RE: Cell reference for chart point

Hello,

If you want to apply data label to a specific point you must use point index. For example, if Sheet1.Range("C1") represent point number two in the series, use the following code:

ActiveChart.SeriesCollection(1).Points(2).ApplyDataLabels

If you want to apply data label to all points in the series, use the following code:

ActiveChart.SeriesCollection(1).ApplyDataLabels

I hope this will help you.

 

Best regards.