P
Phil Hageman
In Module3 of a workbook (solely dedicated to
LastPointLabel) I have downloaded/copied the following
code from your geocities website:
Option Explicit
Sub Create_Menu().
Sub Delete_Menu().
Sub LastPointLabel().
Opening the worksheet containing imbedded charts, I run
the LastPointLabel macro and receive: Run-time error '91':
Object variable or With block variable not set.
The line: For Each. in the code is highlighted yellow
Sub LastPointLabel()
Dim mySrs As Series
Dim nPts As Long
For Each mySrs In ActiveChart.SeriesCollection
With mySrs
nPts = .Points.Count
mySrs.Points(nPts).ApplyDataLabels _
Type:=xlDataLabelsShowValue, _
AutoText:=True, LegendKey:=False
mySrs.Points(nPts).DataLabel.Text = mySrs.Name
End With
Next
End Sub
What do I need to do to make this work?
LastPointLabel) I have downloaded/copied the following
code from your geocities website:
Option Explicit
Sub Create_Menu().
Sub Delete_Menu().
Sub LastPointLabel().
Opening the worksheet containing imbedded charts, I run
the LastPointLabel macro and receive: Run-time error '91':
Object variable or With block variable not set.
The line: For Each. in the code is highlighted yellow
Sub LastPointLabel()
Dim mySrs As Series
Dim nPts As Long
For Each mySrs In ActiveChart.SeriesCollection
With mySrs
nPts = .Points.Count
mySrs.Points(nPts).ApplyDataLabels _
Type:=xlDataLabelsShowValue, _
AutoText:=True, LegendKey:=False
mySrs.Points(nPts).DataLabel.Text = mySrs.Name
End With
Next
End Sub
What do I need to do to make this work?