Need help with cyntax when using Range to define plot range
Posted by Edward C. on April 10, 2001 11:17 AM
I was given a marco that created a plot over a fixed range and was asked to generalize it work work for any size range. I created a set of Range varables to store the min and max column address over which I want my series in my plot to span. When I check the address in the Range variable ( IE: ARange.Address = $A$503:$A$2353 ) it seems to be fine. However, I am doing something wrong in the way I am using the Range in the argument list for the plot. I tried the statement below both with and without the " "'s but could not get it to work. Could someone tell me what I am doing wrong?
Thanks,
Edward
Charts.Add
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
' ActiveChart.SetSourceData Source:=Sheets("Veh1_NY_20010321_1957").Range( _
' "A1:A2664,H1:H2664,AV1:AV2664,CH1:CH2664"), PlotBy:=xlColumns
' ActiveChart.SetSourceData Source:=Sheets("Veh1_NY_20010321_1957").Range( _
' ARange, _
' HRange, _
' AVRange, _
' CHRange), PlotBy:=xlColumns
ActiveChart.SetSourceData Source:=Sheets("Veh1_NY_20010321_1957").Range( _
"ARange.Address, HRange.Address, AVRange.Address, CHRange.Address"), PlotBy:=xlColumns