Use named range for chart data labels

ThomasOES

Board Regular
Joined
Aug 29, 2017
Messages
174
Hello the code below works to put data labels onto points in a graph. However I would like a named range to replace the msoChartFieldRange

Code:
.FullSeriesCollection(1).DataLabels.Format _
        .TextFrame2.TextRange.InsertChartField _
            msoChartFieldRange, "=Al!$A$45:$A$50", 0


Something like

Code:
[COLOR=#222222][FONT=Verdana].FullSeriesCollection(1).DataLabels.Format _[/FONT][/COLOR]
[COLOR=#222222][FONT=Verdana]        .TextFrame2.TextRange = Range("StdList")[/FONT][/COLOR]


I cant get it to work. Any help would be much appreciated.

Tom
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I found a way

Code:
With ActiveChart
    .SeriesCollection.NewSeries
    With .FullSeriesCollection(1)
    .XValues = Range("StdCalc")
    .Values = Range("StdVal")
        With .DataLabels
            .Format.TextFrame2.TextRange.InsertChartField msoChartFieldRange, _
            "='" & ActiveSheet.Name & "'!" & Range("StdList").Address(0, 0), 0
            .ShowRange = True
        End With
    End With
End With

"StdList is the named range
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top