|
> ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(Cells(k, 2), Cells(k, 4)), PlotBy:= _
> xlRows
↓
ActiveChart.SetSourceData _
Source:=Sheets("Sheet1").Range(Sheets("Sheet1").Cells(k, 2), _
Sheets("Sheet1").Cells(k, 4)), PlotBy:=xlRows
又は
With Sheets("Sheet1")
ActiveChart.SetSourceData Source:=.Range(.Cells(k, 2), .Cells(k, 4)), PlotBy:=xlRows
End With
など
――――――――――――――――――――――――――――――――――――
サンプル
Sub Macro3()
Dim k As Long
Dim sht As Worksheet
Set sht = Sheets("Sheet1")
For k = 2 To Range("A65536").End(xlUp).Row
If k > Worksheets.Count Then
Worksheets.Add After:=Worksheets(k - 1)
ActiveSheet.Name = "Sheet" & k
End If
With Charts.Add
.ChartType = xlRadarMarkers
.SetSourceData Source:=sht.Range(sht.Cells(k, 2), sht.Cells(k, 4)), PlotBy:=xlRows
.SeriesCollection(1).XValues = "=Sheet1!R1C2:R1C4"
.Location Where:=xlLocationAsObject, Name:="Sheet" & k
End With
Range("A1").Select
Next k
End Sub
|
|