Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default QUESTION ON "OFFSET" !



When I call "offset(some number)" on some defined range as in "Set rng
= rng.offset(5)" it offsets the range downwards.

How should I code it if I want the range to :

(1) offset(5) to the right

(2) offset(5) upwards.

Any assistnce would be appreciated. Thanks.

Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default QUESTION ON "OFFSET" !

Jay,

1) ActiveCell.Offset(0, 5).Select

2) ActiveCell.Offset(-5,0).Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jay dean" wrote in message
...


When I call "offset(some number)" on some defined range as in "Set rng
= rng.offset(5)" it offsets the range downwards.

How should I code it if I want the range to :

(1) offset(5) to the right

(2) offset(5) upwards.

Any assistnce would be appreciated. Thanks.

Jay Dean

*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default QUESTION ON "OFFSET" !

Hi Jay,
From Help.
expression.Offset(RowOffset, ColumnOffset)

expression Required. An expression that returns a Range object.

RowOffset Optional Variant. The number of rows (positive, negative, or 0
(zero)) by which the range is to be offset. Positive values are offset
downward, and negative values are offset upward. The default value is 0.

ColumnOffset Optional Variant. The number of columns (positive, negative,
or 0 (zero)) by which the range is to be offset. Positive values are offset
to the right, and negative values are offset to the left. The default value
is 0.

So offset(5), no column specified, moves 5 rows down.
offset(-5) moves up 5 rows.
offset(,5) moves right 5.
offset(-5,5) moves up 5 and right 5.



--

John

johnf202 at hotmail dot com


"jay dean" wrote in message
...


When I call "offset(some number)" on some defined range as in "Set rng
= rng.offset(5)" it offsets the range downwards.

How should I code it if I want the range to :

(1) offset(5) to the right

(2) offset(5) upwards.

Any assistnce would be appreciated. Thanks.

Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default QUESTION ON "OFFSET" !

Jay,

Offset has a row and a column argument. And, it can take negative numbers.
So you can use

.Offset(3,1)

which references 3 rows down, 1 column to the right, or

.Offset(-3,-1)

which references 3 rows up and 1 column to the left.

Just be careful that you don't reference an invalid range. For instance, if
you are in cell A3, and you use

.Offset(0,-1)

you will get an error as you are trying top reference a non-existent range.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jay dean" wrote in message
...


When I call "offset(some number)" on some defined range as in "Set rng
= rng.offset(5)" it offsets the range downwards.

How should I code it if I want the range to :

(1) offset(5) to the right

(2) offset(5) upwards.

Any assistnce would be appreciated. Thanks.

Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default QUESTION ON "OFFSET" !



Thank you all for the info !

Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Can I make a "tab name" the "chart title"? (question on this) [email protected] Charts and Charting in Excel 2 April 15th 09 06:26 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I use "offset" function in "array formula"? hongguang Excel Discussion (Misc queries) 3 April 4th 07 12:04 AM
"Disk is Full" add-on question to "Can't reset last cell" post tod [email protected] Excel Discussion (Misc queries) 0 January 22nd 07 02:32 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 08:39 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"