ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Graph Ranges (https://www.excelbanter.com/excel-programming/343001-graph-ranges.html)

simonweller

Graph Ranges
 

I have a databse that is growing daily, and I would like users to via a
list box select a start and finish date therefore creating a new
range.

This new range will now alter a graph to match the users selection.


--
simonweller
------------------------------------------------------------------------
simonweller's Profile: http://www.excelforum.com/member.php...o&userid=28157
View this thread: http://www.excelforum.com/showthread...hreadid=476779


Baapi[_15_]

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



All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com