Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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") ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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") ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to define a charts range based on the value of a cell chris Excel Discussion (Misc queries) 1 December 2nd 09 04:34 PM
How to define a range based on first and last cells with data? Dennis Excel Programming 5 March 1st 06 01:45 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
Define a Dynamic Range Based on an Index Mike Roberto Excel Programming 4 August 5th 04 02:02 PM
problem using Set statement to define range object mel Excel Programming 0 February 4th 04 06:10 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"