|
Sub Mk_Charts2()
Dim i As Long, j As Long
Dim Sh As Worksheet
Dim Ch As Chart, Se As Series
Dim GR As Range
j = 2: Application.ScreenUpdating = False
Set Sh = Worksheets.Add(Before:=Worksheets(1))
Sh.Name = "グラフ": ActiveWindow.DisplayGridlines = False
With Worksheets("Sheet1").Range("A1").CurrentRegion
For i = 2 To .Columns.Count
Set GR = Sh.Cells(j, 2).Resize(20, 8)
Set Ch = Sh.ChartObjects _
.Add(GR.Left, GR.Top, GR.Width, GR.Height).Chart
Ch.ChartType = xlXYScatterLinesNoMarkers
Set Se = Ch.SeriesCollection.NewSeries
Se.Values = .Columns(1): Se.XValues = .Columns(i)
Ch.Axes(xlValue).HasTitle = True
Ch.Axes(xlValue).AxisTitle.Caption = "荷重(kN)"
Ch.Axes(xlCategory).HasTitle = True
Ch.Axes(xlCategory).AxisTitle.Caption = "ひずみ"
Ch.HasLegend = False
Set GR = Nothing: Set Ch = Nothing: Set Se = Nothing
j = j + 21
Next i
End With
Application.ScreenUpdating = True: Set Sh = Nothing
End Sub
で、どうかな ?
|
|