ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Re : MS Excel’s Offset Property (https://www.excelbanter.com/excel-programming/271145-re-ms-excel-8217%3Bs-offset-property.html)

TKT-Tang

Re : MS Excel’s Offset Property
 
Re : MS Excel’s Offset Property

The following example selects the cell three rows down from and one
column to the right of the cell in the upper-left corner of the
current selection.

Worksheets("sheet1").Activate
Selection.Offset(3, 1).Range("A1").Select

The question is,
what is the significance of dotting with Range("A1") ?

Regards.

J.E. McGimpsey

MS Excel’s Offset Property
 
It's just a waste of cycles - using the Range property of a range
offsets the range by an amount equivalent to the offset of the
reference from A1.

Since I can't even parse that sentence at this hour, here's an
example, assume the Selection is at F8. Then

Selection.Offset(3,1).Select selects G11

Selection.Offset(3, 1).Range("A1").Select also selects G11

Selection.Offset(3, 1).Range("B1").Select selects H11

Selection.Offset(3, 1).Range("A2").Select selects G12

Selection.Offset(3, 1).Range("B2").Select selects H12

In article ,
(TKT-Tang) wrote:

Re : MS Excel’s Offset Property

The following example selects the cell three rows down from and one
column to the right of the cell in the upper-left corner of the
current selection.

Worksheets("sheet1").Activate
Selection.Offset(3, 1).Range("A1").Select

The question is,
what is the significance of dotting with Range("A1") ?

Regards.


Dave Peterson[_3_]

Re : MS Excel’s Offset Property
 
But it does resize the selection to exactly one cell. If you didn't have that,
then the new selection would be the same size as the starting selection.



TKT-Tang wrote:

Re : MS Excel’s Offset Property

The following example selects the cell three rows down from and one
column to the right of the cell in the upper-left corner of the
current selection.

Worksheets("sheet1").Activate
Selection.Offset(3, 1).Range("A1").Select

The question is,
what is the significance of dotting with Range("A1") ?

Regards.


--

Dave Peterson



All times are GMT +1. The time now is 11:48 AM.

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