Thread: ranges
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
greg greg is offline
external usenet poster
 
Posts: 108
Default ranges

Well, as I look at the data in the first range. By values I need to grab a
second range.
Don't you actually use the first range as the starting point? to create a
second range.
So let me switch the first range to A20 to g40
and I want to grab
A30 to G 35.
Do you use 20 as the first row? And grab 10 to 15? or something like that?

Hope i am explaining this ok





"Rick Rothstein" wrote in message
...
Describe the "on the fly" part of your message; that is, how is the A4 and
G7 cell limits being obtained? I ask because I would think you could just
use something like this...

Start = "A4" {by whatever means you use to obtain it}
Finish = "G7" {by whatever means you use to obtain it}
Set rSubRange = Range(Start & ":" & Finish)

--
Rick (MVP - Excel)


"greg" wrote in message
...
Hello,
Suppose I have a table in excel. A1 to 12 G. It is defined as MyTable.

now I want to programatically grab or define a sub range.
Say A4 to G7.

How can this be done?
If I have
Dim rRange as Range
Dim rRange2 as Range
set rRange = Range("MyTable")

How can I get the second range, from the first, on the fly?

thanks