|
첨부파일의 data입력 부분에 나오는 차트를 코딩하고 싶습니다. 초보러 메크로로 돌려서 나오는 소스를 보고도 어떻게 코딩해야 되는지 모르겠습니다. 이 차트의 전체 코딩은 바라지도 않습니다. 어떻게 코딩해야 되는지 예를 들어 설명
해주시면 고맙겠습니다. 참고로 OLE로 하는 법은 모릅니다. 꼭 도와주세요.
<각축>
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = -6
.MaximumScale = 6
.MinorUnit = 0.4
.MajorUnit = 2
.Crosses = xlCustom
.CrossesAt = 0
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "돋움"
.FontStyle = "보통"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Selection.TickLabels.NumberFormatLinked = True
End Sub
<각 주축선>
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("07-02892-001(60WN1064).xls").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("07-02892-001(60WN1064).xls").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
With Selection.Border
.ColorIndex = 57
.Weight = xlThin
.LineStyle = xlContinuous
End With
With ActiveChart.Axes(xlValue)
.MinimumScale = -6
.MaximumScale = 6
.MinorUnit = 0.4
.MajorUnit = 2
.Crosses = xlCustom
.CrossesAt = 0
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
<그림영역>
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveChart.PlotArea.Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 24
.PatternColorIndex = 2
.Pattern = xlSolid
End With
<차트영역>
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveChart.ChartArea.Select
With Selection.Border
.Weight = 1
.LineStyle = -1
End With
Selection.Interior.ColorIndex = xlAutomatic
Sheets("Sheet4").DrawingObjects("Chart 1").RoundedCorners = False
Sheets("Sheet4").DrawingObjects("Chart 1").Shadow = False
Selection.AutoScaleFont = True
With Selection.Font
.Name = "돋움"
.FontStyle = "보통"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
With Sheets("Sheet4").DrawingObjects("Chart 1")
.Placement = xlMoveAndSize
.PrintObject = True
End With
Sheets("Sheet4").DrawingObjects("Chart 1").Locked = True
<항목 축>
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveChart.Axes(xlCategory).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
With Selection
.MajorTickMark = xlInside
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With ActiveChart.Axes(xlCategory)
.CrossesAt = 1
.TickLabelSpacing = 1
.TickMarkSpacing = 1
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "돋움"
.FontStyle = "보통"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Selection.TickLabels.NumberFormatLinked = True
With Selection.TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlAutomatic
End With
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
<계열1>
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveWindow.Visible = False
ActiveSheet.ChartObjects("Chart 1").Activate
Windows("Book1").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
With Selection
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlX
.Smooth = False
.MarkerSize = 5
.Shadow = False
End With
ActiveChart.SeriesCollection(1).AxisGroup = 1
ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY, Include:=xlNone, _
Type:=xlFixedValue, Amount:=2
|