How to set all data labels with Series Name at once in an Excel 2010 chart

Anonymous
2016-04-13T09:44:25+00:00

I can't find how to set all data labels with Series Name at once. Do you know how? It's Excel 2010.

Do I really need to apply that format one series at a time? :(

The problem is *selection*, I can't select the labels from several series simultaneously.

I posed this question in Twitter first.

Thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2016-04-14T02:27:09+00:00

    Hello,

    chart series data labels are set one series at a time. If you don't want to do it manually, you can use VBA. Something along the lines of

    Sub setDataLabels()

    '

    ' sets data labels in all charts

    '

    Dim sr As Series

    Dim cht As ChartObject

    '

    With ActiveSheet

        For Each cht In .ChartObjects

            For Each sr In cht.Chart.SeriesCollection

                sr.ApplyDataLabels

                With sr.DataLabels

                    .ShowCategoryName = True

                    .ShowValue = False

                    .ShowSeriesName = True

                End With

            Next sr

        Next cht

    End With

    End Sub

    Right-click the sheet tab, select View Code and paste the code into the code window. 

    Set the desired True/False value for the three lines with the .Show[...] properties and hit F5 to run the macro on all charts in the sheet.

    27 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2016-04-14T01:38:38+00:00
    1 person found this answer helpful.
    0 comments No comments