Hi there,
I want to create and alter several charts
By recording a macro I think I am nearly there.
However this line does not work?
ActiveSheet.ChartObjects("Chart" & i).Activate
Can someone please advise
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 05/07/2011 by HP
'
'
For i = 5 To 10
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows("RBS_USD_data2.xls").Activate
'Range("L32").Select
Cells(34, 2).Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart" & i).Activate
ActiveChart.SeriesCollection(1).XValues = "=Sheet2!R839C1:R1548C1"
ActiveChart.SeriesCollection(1).Values = "=Sheet2!R839C2:R1548C2"
ActiveChart.SeriesCollection(2).XValues = "=Sheet2!R839C1:R1548C1"
ActiveChart.SeriesCollection(2).Values = "=Sheet2!R839C9:R1548C9"
Next i
End Sub
I want to create and alter several charts
By recording a macro I think I am nearly there.
However this line does not work?
ActiveSheet.ChartObjects("Chart" & i).Activate
Can someone please advise
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 05/07/2011 by HP
'
'
For i = 5 To 10
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows("RBS_USD_data2.xls").Activate
'Range("L32").Select
Cells(34, 2).Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart" & i).Activate
ActiveChart.SeriesCollection(1).XValues = "=Sheet2!R839C1:R1548C1"
ActiveChart.SeriesCollection(1).Values = "=Sheet2!R839C2:R1548C2"
ActiveChart.SeriesCollection(2).XValues = "=Sheet2!R839C1:R1548C1"
ActiveChart.SeriesCollection(2).Values = "=Sheet2!R839C9:R1548C9"
Next i
End Sub