ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Define a Range based on a Range object (https://www.excelbanter.com/excel-programming/443754-define-range-based-range-object.html)

Terry

Define a Range based on a Range object
 

Given a Range object (e.g: set xRange = Range("C1:D10") )

And given xRow = 5 , which stands for Row 5 (absolute Row index)

How to define a range "yRange" based on "xRange" so that yRange is
Range("C5:D10") ?

Rick Rothstein

Define a Range based on a Range object
 
I just posted a response to this same question over in the Microsoft forum
(I'm assuming you posted it there as the ranges look familiar).

--
Rick Rothstein (MVP - Excel)


"Terry" wrote in message
...

Given a Range object (e.g: set xRange = Range("C1:D10") )

And given xRow = 5 , which stands for Row 5 (absolute Row index)

How to define a range "yRange" based on "xRange" so that yRange is
Range("C5:D10") ?



Terry

Define a Range based on a Range object
 
On Oct 14, 11:40*pm, "Rick Rothstein"
wrote:
I just posted a response to this same question over in the Microsoft forum
(I'm assuming you posted it there as the ranges look familiar).

--
Rick Rothstein (MVP - Excel)

"Terry" wrote in message

...



Given a Range object (e.g: set xRange = *Range("C1:D10") )


And given xRow = 5 , which stands for Row 5 (absolute Row index)


How to define a range "yRange" based on "xRange" so that yRange is
Range("C5:D10") ?




yes thanks

CompleteNewb[_2_]

Define a Range based on a Range object
 
Can you guys either copy the response here or give a link to the post in the
other newsgroup? I searched the Microsoft forums for both you guys as
authors, as well as looking for the subject line and the range reference
text, and found nothing.

And this seems like a question that's totally related to things I'm having
issues with now.

Thanks.

"Terry" wrote in message
...
On Oct 14, 11:40 pm, "Rick Rothstein"
wrote:
I just posted a response to this same question over in the Microsoft forum
(I'm assuming you posted it there as the ranges look familiar).

--
Rick Rothstein (MVP - Excel)

"Terry" wrote in message

...



Given a Range object (e.g: set xRange = Range("C1:D10") )


And given xRow = 5 , which stands for Row 5 (absolute Row index)


How to define a range "yRange" based on "xRange" so that yRange is
Range("C5:D10") ?




yes thanks


Rick Rothstein

Define a Range based on a Range object
 
Sorry for the delay in responding (I don't visit the newsgroups that often
anymore). Here is a link to the thread I mentioned...

http://social.answers.microsoft.com/...7-d22f6dca8a92

but to save you the time of searching it out, here is what I responded over
there...

Consider this...

Dim xRange As Range, yRange As Range, NewRowBeginning As Long
NewRowBeginning = 5
Set xRange = Range("C1:D10")
Set yRange = Intersect(xRange, Range(NewRowBeginning & ":" & Rows.Count))
'
' Test to see if the range came out right
'
If Not yRange Is Nothing Then
MsgBox yRange.Address(0, 0)
Else
MsgBox "The specified new row beginning is located below the specified
range"
End If

--
Rick Rothstein (MVP - Excel)



"CompleteNewb" wrote in message
...
Can you guys either copy the response here or give a link to the post in
the other newsgroup? I searched the Microsoft forums for both you guys as
authors, as well as looking for the subject line and the range reference
text, and found nothing.

And this seems like a question that's totally related to things I'm having
issues with now.

Thanks.

"Terry" wrote in message
...
On Oct 14, 11:40 pm, "Rick Rothstein"
wrote:
I just posted a response to this same question over in the Microsoft
forum
(I'm assuming you posted it there as the ranges look familiar).

--
Rick Rothstein (MVP - Excel)

"Terry" wrote in message

...



Given a Range object (e.g: set xRange = Range("C1:D10") )


And given xRow = 5 , which stands for Row 5 (absolute Row index)


How to define a range "yRange" based on "xRange" so that yRange is
Range("C5:D10") ?




yes thanks




All times are GMT +1. The time now is 02:16 AM.

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