Range type of question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
With Sheets(1)
ActiveChart.SeriesCollection(1).XValues = _
..Range(.Cells(2,ColIndex),.Cells(LastRow,ColIndex))
End with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top