You are on page 1of 1

Sub 레이블설정()

Dim myCht As ChartObject


Dim n As Long
Dim adr As String
Dim p As Range

Application.ScreenUpdating = False
For Each myCht In ActiveSheet.ChartObjects
With myCht.Chart
adr = .SeriesCollection(2).Formula
adr = Split(adr, ",")(1)
For n = 1 To Range(adr).Cells.Count
.SeriesCollection(2).Points(n).HasDataLabel = False
.SeriesCollection(2).Points(n).MarkerStyle = -4142

Next n
End With
Next myCht
n = 0
For Each myCht In ActiveSheet.ChartObjects
With myCht.Chart
adr = .SeriesCollection(2).Formula
adr = Split(adr, ",")(1)
For Each p In Range(adr)
n = n + 1
With .SeriesCollection(2).Points(n)
.HasDataLabel = True
.MarkerStyle = 2
.MarkerSize = 10
.DataLabel.Text = "좌표(" & p & "," & p.Offset(1, 0) & ")"
.Format.Fill.ForeColor.RGB = RGB(255, 0, 0)
End With
.SeriesCollection(2).DataLabels.Position = xlLabelPositionAbove
Next p
End With
Next myCht
End Sub

You might also like