Hi,
I recorded with macro recorder VBA code wich will change data range in chart.
Code is like this:
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B2:L5"), PlotBy:= _
xlRows
ActiveWindow.Visible = False
Windows("Proov.xls").Activate
Range("A1").Select
Is it possible and if it is, then how to make the code so that it would choose source data to be only so much cells, where are info?
Right now I have that problem, that my excel chart is half empty. I assigned data range B2:AQ2, but some time info is only in B2:Y2, sometime in B2:S2 and sometime in B2:AQ2.
So what I want is that excel would automatically change data range according where is info.
Can someone help me?
I recorded with macro recorder VBA code wich will change data range in chart.
Code is like this:
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B2:L5"), PlotBy:= _
xlRows
ActiveWindow.Visible = False
Windows("Proov.xls").Activate
Range("A1").Select
Is it possible and if it is, then how to make the code so that it would choose source data to be only so much cells, where are info?
Right now I have that problem, that my excel chart is half empty. I assigned data range B2:AQ2, but some time info is only in B2:Y2, sometime in B2:S2 and sometime in B2:AQ2.
So what I want is that excel would automatically change data range according where is info.
Can someone help me?