トップページ⇒tech
2コメント1KB

エクセルについて

■ このスレッドは過去ログ倉庫に格納されています
0001"エクセル"初心者NGNG
エクセルでグラフを書く時に、
グラフのソースをCellsを使って指定をしたいのですが、
どうしてもできません。よろしければ教えてください。
お願いします。

Sub Macro()

Range(Cells(1@` 1)@` Cells(9@` 2)).Select
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(Cells(1@` 1)@` Cells(9@` 2))@` PlotBy:= _
xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Range(Cells(1@` 1)@` Cells(5@` 1))
ActiveChart.SeriesCollection(1).Values = Range(Cells(1@` 2)@` Cells(5@` 2))
ActiveChart.SeriesCollection(2).XValues = Range(Cells(6@` 1)@` Cells(7@` 1))
ActiveChart.SeriesCollection(2).Values = Range(Cells(6@` 2)@` Cells(7@` 2))
ActiveChart.SeriesCollection(3).XValues = Range(Cells(8@` 1)@` Cells(9@` 1))
ActiveChart.SeriesCollection(3).Values = Range(Cells(8@` 2)@` Cells(9@` 2))
ActiveChart.Location Where:=xlLocationAsObject@` Name:="Sheet1"
End Sub
0002電化製品NGNG
Copy or Pasteを使うというのは?

Range(Cells(1@` 1)@` Cells(9@` 2)).Copy <Copyにして
Sheets("Sheet1").Charts("name").Paste

だめ?
■ このスレッドは過去ログ倉庫に格納されています