View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Cell references when creating charts

=range(cells(row,column),cells(row,column)).Addres s(1,1,xlA1,True)

or change xlA1 to xlR1C1

or just
With Worksheets("Sheet1")
set rng = .range(.cells(row,column),.cells(row,column))
End with
ActiveChart.SeriesCollection(1).Values = rng

--
Regards,
Tom Ogilvy



"Laura" wrote:

I want to refer to my cell range using
range(cells(row,column),cells(row,column))
as I am running this within a loop. However the only code I can get to work
is the two forms below. Is there another way or can I use the above syntax a
different way to get around this?

Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection(1).Values = Sheets("EV3
flow").Range("B10:B446")
ActiveChart.SeriesCollection(1).XValues ="='EV3 depth'!R10C2:R446C2"