View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Range type of question

With Sheets(1)
ActiveChart.SeriesCollection(1).XValues = _
..Range(.Cells(2,ColIndex),.Cells(LastRow,ColIndex ))
End with

--
Regards,
Tom Ogilvy

"Ben H" wrote in message
...
Hi All!

I am updating some code and need to figure a way to change the code to
something different from the .Range("B1") way. I have at least 2

different
data series that are going to be ploted this way. This is what I have and
would like to change it to something like the 2nd example below

ActiveChart.SeriesCollection(1).XValues = Sheets(1).Range("C2:C10001")
ActiveChart.SeriesCollection(1).Values =

Sheets(1).Range("Cr2:Cr10001")
ActiveChart.SeriesCollection(1).Name = Sheets(1).Range("cr1")

ActiveChart.SeriesCollection(1).XValues =
Sheets(1).Range(2,ColIndex:LastRow,ColIndex)

I tried to use the Cells command but with very little luck

Thanks!