P
Pitbull
Hello everyone!
I am trying to create a macro that will change my graph's
data range in function of a specific cell's data.
So, for example, if my cell a1 = Month3, I want my graph
data range to be from a5 to d5.
but, if my cell a1= month5, I want the graph data range to
be from a5 to F5.
I tried recording the macro and selecting my data range
using this when I go to the graph/source data/data range --
-> =indirect(a1)
But then, it just takes this indirect a1 and makes it into
the given range (for example month3 turns out to make my
data range---> =a5:d5
Hope this is not too confusing.
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("OEE Raw
Data").Range("A5:F6"), _
PlotBy:=xlRows
The 3rd line is what I need to change I think...
source:=indirect type of function thing...
Can anyone help?
Thanks
Pitbull
I am trying to create a macro that will change my graph's
data range in function of a specific cell's data.
So, for example, if my cell a1 = Month3, I want my graph
data range to be from a5 to d5.
but, if my cell a1= month5, I want the graph data range to
be from a5 to F5.
I tried recording the macro and selecting my data range
using this when I go to the graph/source data/data range --
-> =indirect(a1)
But then, it just takes this indirect a1 and makes it into
the given range (for example month3 turns out to make my
data range---> =a5:d5
Hope this is not too confusing.
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("OEE Raw
Data").Range("A5:F6"), _
PlotBy:=xlRows
The 3rd line is what I need to change I think...
source:=indirect type of function thing...
Can anyone help?
Thanks
Pitbull