|    | 
     すいません。。。コードは以下の通りです 
 
Sub Program1() 
 
 Dim ThisSheet_Name As String 
 Dim a As Long 
 ThisSheet_Name = ActiveSheet.Name 'アクティブシート名を取得 
  With Charts.Add '空のグラフをに作成する 
   .Location Where:=xlLocationAsObject, Name:=ThisSheet_Name 
  End With 
For a = 1 To 10 
  ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Activate '常に最新のグラフを選択する 
  ActiveChart.ChartType = xlLine 
  ActiveChart.SeriesCollection.NewSeries 
 With ActiveChart.SeriesCollection(a) 
 'X軸を選択 
 Dim xCell As Range 
 Set xCell = Application.InputBox(Prompt:="X軸DATAの先頭を選択してください。", Default:="A1", Type:=8) 
 xCell.Select 
 b = xCell.Address 
 c = Range(b).End(xlDown).Address(False, False) 
 'Y軸を選択 
 Dim yCell As Range 
 Set yCell = Application.InputBox(Prompt:="y軸DATAの先頭を選択してください。", Default:="A1", Type:=8) 
 yCell.Select 
 d = yCell.Address 
 e = Range(d).End(xlDown).Address(False, False) 
 '要素名を選択 
 Dim nameCell As Range 
 Set nameCell = Application.InputBox(Prompt:="y軸項目名を選択してください。", Default:="A1", Type:=8) 
 nameCell.Select 
 f = nameCell.Address 
 'グラフを書く 
  .ChartType = xlLine 
  .XValues = Range(b, c) 
  .Values = Range(d, e) 
  .Name = Range(f) 
 End With 
 '追加 
 n% = MsgBox("波形を追加しますか?", vbYesNo + vbQuestion, "") 
 If n% = vbNo Then End 
Next a 
 
End Sub 
 
これのData選択時、シートをまたがって選択できるようにしたいと思っております。 
宜しくお願いします。 
 
 | 
     
    
   |