Thread: Graph Ranges
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Baapi[_15_] Baapi[_15_] is offline
external usenet poster
 
Posts: 1
Default Graph Ranges


Try something like this

ActiveSheet.ChartObjects("Chart 40").Activate
ActiveChart.SeriesCollection(1).XValues = "=Calculations!R2C66:R"
eRow & "C66"
ActiveChart.SeriesCollection(1).Values = "=Calculations!R2C68:R" & eRo
& "C68"

XValues represents the X-Axis values and

read this as
"=Calculations!R2C66:R" & eRow & "C66"

Sheetname: Calculations
X-Axis Start Value stored at R2C66 (2nd Row and 66th Column)
X-Axis End Value is Calculated and stored in Variable(Integer type
eRow

to find out the last row containing data, you can use the followin
statement
eRow = Worksheets("Calculations").Cells(Rows.Count, 1).End(xlUp).Row

"1" here in the ablove statement is the column (column number) in whic
you want to search for the last row

This should help yo

--
Baap
-----------------------------------------------------------------------
Baapi's Profile: http://www.excelforum.com/member.php...fo&userid=2733
View this thread: http://www.excelforum.com/showthread.php?threadid=47677