Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I automatically label graph points from my data tables in Excel?

0
10 Posted

How can I automatically label graph points from my data tables in Excel?

0
10

Here is a macro that will do the trick. I assume that the chart data that you have given is in the range A1:C5. I also assume that you have created only one chart so we can refer to it as “Chart 1” and that you have added data labels (it doesn’t matter what they say at this point). This macro starts with cell C1 and populates each successive data label until it sees a blank cell in column C so make sure there is a blank cell in column C just below your last locality no. You will need to paste this code into a VB module. Right-click on a sheet tab and choose View Code. Press control-R to display the Project Explorer dialog if it isn’t already displayed (it usually says Pfoject – VBAProject in it’s title). In the project explorer right-click your workbook name and choose Insert > Module Paste this code: Sub ChangeDataLabels() Dim intPoint As Integer Dim rngLocality As Range intPoint = 1 Set rngLocality = Range(“C1”) With ActiveSheet.ChartObjects(“Chart 1”).Chart.SeriesCollection(1) Do Wh

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123