Greetings,
I am running into an error in defining the source data in the active chart on the line:
How am I able to define the value currently "A(element)" as the worksheet name in such a way that for each worksheet I am able to produce a chart?
If I can further clarify the question please let me know.
I am running into an error in defining the source data in the active chart on the line:
VBA Code:
ActiveChart.SetSourceData Source:=Range( _
"A(element)!$A:$A,A(element)!$E:$E,A(element)!$W:$W")
How am I able to define the value currently "A(element)" as the worksheet name in such a way that for each worksheet I am able to produce a chart?
If I can further clarify the question please let me know.
VBA Code:
A = Array("AAL", "F", "X")
For element = LBound(A) To UBound(A)
ActiveWorkbook.Worksheets(A(element)).Activate
ActiveWorkbook.ActiveSheet.Range("A:A,E:E,W:W").Select
ActiveSheet.Shapes.AddChart2(227, xlLine).Select
ActiveChart.SetSourceData Source:=Range( _
"A(element)!$A:$A,A(element)!$E:$E,A(element)!$W:$W")