Alex Gordon
Alex Gordon

Reputation: 60751

feeding data labels into excel with VBA

i have a scatter plot graph

i would like each dot to have a label.

how do i feed in labels through VBA for each dot?

Upvotes: 1

Views: 901

Answers (1)

Oorang
Oorang

Reputation: 6780

You're after the ApplyDataLabels method. Make sure you read the documentation, it has a lot of optional parameters.

Sub Example()
    Dim sc As Excel.Series
    For Each sc In Chart2.SeriesCollection
        sc.ApplyDataLabels xlDataLabelsShowValue, True, True, False, True
    Next
End Sub

Upvotes: 2

Related Questions