Re : MS Excel’s Offset Property

T

TKT-Tang

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

J.E. McGimpsey

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
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top