LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default VBA equivalent to =OFFSET(....

I want to create a range in VBA in a similar fashion to the worksheet
function OFFSET. E.g..

=Offset(MyNamedRange,10,1,0,-5)

Which would give me a 10 x 1 range, 5 columns to the left of
"MyNamedRange" (which is a single cell).

How would I do this in VBA? I intend to use this range and another
range in the VBA 'Intersect' function to create a third range.

My expereimental code is something like this (after declaring and
setting the various variables)...

TestVals = Application.Offset(Cyc.Range("CurrentPowerDist"), 0, -6, r,
0)
MaxVal = Cyc.Range("CurrentPowerDist").Offset(-2, -6)
MaxRng = Intersect(TestVals, MaxVal)

Thanks
Nick
 
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
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Worksheet Functions 2 September 28th 07 10:54 PM
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Programming 4 September 28th 07 09:59 PM
Find, Copy offset to offset on other sheet, Run-time 1004. Finny[_3_] Excel Programming 10 December 7th 06 11:46 PM
Equivalent Of VAL davidm Excel Programming 4 July 27th 05 06:22 PM
VBA equivalent of MATCH() Mike Echo Excel Programming 1 May 10th 05 10:54 AM


All times are GMT +1. The time now is 08:24 AM.

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

About Us

"It's about Microsoft Excel"