Thanks, Hans. Would you know where one would find documentation for such functions?
P.S. Below, I added my slight modification of the code from the referenced Microsoft site. For those experienced with manipulating chart objects and dialog boxes, it's trivial, but for those like me who are looking for pre-canned code, it could save them
a morning. The test case is a table:
Labels x y
dog 2 5
cat 6 3
horse 6 5
mouse 1 1
**** 3 2
wok 8 7
duk 6 8
cluk 1 3
suk 3 0
wuk 2 8
muk 3 9
Sub AttachLabelsToPoints()
'Dimension variables.
Dim Counter As Integer, ChartName As String, xVals As String
Dim rgLabelHed As Range
' ' Disable screen updating while the subroutine is run.
' Application.ScreenUpdating = False
' 'Store the formula for the first series in "xVals".
' xVals = ActiveChart.SeriesCollection(1).Formula
'''''''''''''''''''''''''''''''''''''''''''''
' User selects series
If TypeName(Selection)<>"Series" Then
MsgBox("Please select a chart series first.")
Exit Sub
End If
xvals = Selection.Formula
'Extract the range for the data from xVals.
xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, _
Mid(Left(xVals, InStr(xVals, "!") - 1), 9)))
xVals = Left(xVals, InStr(InStr(xVals, "!"), xVals, ",") - 1)
Do While Left(xVals, 1) = ","
xVals = Mid(xVals, 2)
Loop
'Get top of column range for labels
'----------------------------------
On Error Resume Next
Set rgLabelHed = Application.InputBox( _
"Select column heading for the labels", _
"Labels", Type:=8)
On Error GoTo 0
If rgLabelHed Is Nothing Then Exit Sub
'Attach a label to each data point in the chart.
For Counter = 1 To Range(xVals).Cells.Count
ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _
rgLabelHed(Counter+1,1)
Next Counter
End Sub