A
anupam
Dim TrendChart As Variant, sourcedata As Variant, i As Integer, n A
Integer, j As Integer
ActiveWorkbook.Names.Add Name:="CSource_1"
RefersToR1C1:="'1'!R1C26:INDEX('1'!C27,COUNTA('1'!C26))"
ActiveWorkbook.Names.Add Name:="CSource_2"
RefersToR1C1:="'2'!R1C26:INDEX('2'!C27,COUNTA('2'!C26))"
sourcedata = Array("CSource_1", "CSource_2", "DSource_2", "CSource_3"
"DSource_3", "CSource_4", .................... "CSource_34"
"DSource_34", _
"CSource_35", "DSource_35")
j = 0
'i = 1
For n = 3 To 5 'Worksheets.Count
Worksheets(n).Select
For i = 0 To Worksheets(n).ChartObjects.Count
Worksheets(n).Select
Worksheets(n).ChartObjects(i + 1).Activate
ActiveChart.SetSourceDat
Source:=Sheets(n).Range(sourcedata(i)), PlotBy:=xlColumns(here i a
getting the error)
i = i + 1
Next i
Next n
Getting error 1004
Integer, j As Integer
ActiveWorkbook.Names.Add Name:="CSource_1"
RefersToR1C1:="'1'!R1C26:INDEX('1'!C27,COUNTA('1'!C26))"
ActiveWorkbook.Names.Add Name:="CSource_2"
RefersToR1C1:="'2'!R1C26:INDEX('2'!C27,COUNTA('2'!C26))"
sourcedata = Array("CSource_1", "CSource_2", "DSource_2", "CSource_3"
"DSource_3", "CSource_4", .................... "CSource_34"
"DSource_34", _
"CSource_35", "DSource_35")
j = 0
'i = 1
For n = 3 To 5 'Worksheets.Count
Worksheets(n).Select
For i = 0 To Worksheets(n).ChartObjects.Count
Worksheets(n).Select
Worksheets(n).ChartObjects(i + 1).Activate
ActiveChart.SetSourceDat
Source:=Sheets(n).Range(sourcedata(i)), PlotBy:=xlColumns(here i a
getting the error)
i = i + 1
Next i
Next n
Getting error 1004