Hi John
Try this
Sub AddRange()
Dim Rrange As Range
'Written by OzGrid Business Applications
'www.ozgrid.com
Set Rrange = Range(Range("A1").End(xlDown), Range("A1").End(xlDown).Offset(15, 0))
Rrange.Select
Set Rrange = Nothing
End Sub
Dave
OzGrid Business Applications
Dave,
Your solution worked with selecting the range. However, I ran into another problem shortly thereafter. In the statement,
ActiveChart.SetSourceData Source:=Sheets(Sheetneeded).Range(???What goes here???), PlotBy:=xlColumns
In the ???What goes here??? I've tried the variable name Rrange with and without quotation marks, the whole Range(range("A1")...etc. statement, and just about everything else I can think of and it keeps giving me an error message at this line. I did not use the:
Set Rrange = Nothing
statement prior to this line so that should not be the problem. Please help if you can. Thanks!!!
Hi John
I haven't tested this, but I would think it would be:
ActiveChart.SetSourceData Source:=Sheets(Sheetneeded).Range(Rrange.address ), PlotBy:=xlColumns
Dave
OzGrid Business Applications
Dave,
Thanks a bunch for your help. I just have (hopefully) one more question.
If I am using non-contiguous ranges (2 of them) to graph, how do I select
them to use in a graph?
Example:
Dim Rrange As Range
Dim Srange As Range
Sheets(Sheetneeded).Select
Set Rrange = Range(Range("A1").End(xlDown), Range("A1").End(xlDown).Offset(-15, 0))
Set Srange = Range(Range("I1").End(xlDown), Range("I1").End(xlDown).Offset(-15, -3))
Range(Rrange, Srange).Select
This ends up selecting a range of both defined ranges and everything in between. Thanks
in advance for your help!!
Thanks a bunch for your help. I just have (hopefully) one more question.
Union(Rrange, Srange).Select