文書番号: 401687
最終更新日: 1998/02/10
Option Explicit
Sub ChangeDataLabel()
WorkSheets("Sheet1").Select
ActiveSheet.DrawingObjects("グラフ 1").Select
ActiveSheet.ChartObjects("グラフ 1").Activate
ActiveChart.ApplyDataLabels Type:=xlShowValue, LegendKey:=False
With ActiveChart.SeriesCollection(2).Points(3)
.DataLabel.Text = "第三四半期"
End With
End Sub
"Sheet1" のセル範囲 B1:B10 の値に変更しています。
Sub ChangeDataLabels()
Dim count As Integer
Charts("Graph1").Select
ActiveChart.ApplyDataLabels Type:=xlShowValue, LegendKey:=False
For count = 1 To 10
With ActiveChart.SeriesCollection(1).Points(count)
.DataLabel.Text = WorkSheets("Sheet1").Cells(count,1). _
Value
End With
With ActiveChart.SeriesCollection(2).Points(count) _
.DataLabel.Text = Worksheets("Sheet1").Cells(count,2). _
Value
End With
Next count
End Sub
Keywords: KBHOWTO KB401687
Technology: kbExcel500 kbExcelSearch kbExcelWinSearch