Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA Excel — Cells, Ranges and Offset : Offset

Off­set:

  • Off­set prop­erty in VBA-Excel is used along with Range.
  • With the help of Off­set prop­erty user can move around in the sheet.

For­mat:

Range(“StartingPoint”).Offset(NoOfRowsToBeMoved , NoOfColumnsToBeMoved)

Exam­ple :

Range(“A2”).Offset(1,0).Select

And com­piler reads, move one cell down from A2 , which is A3.

Range(“A2”).Offset(-1,0).Select

And com­piler reads, move one cell Up from A2 , which is A1.

Range(“A2”).Offset(1,1).Select

And com­piler reads, move one cell down and one cell right from A2 , which is B3.

ActiveCell.Offset(1,1)

And com­piler reads, move one cell down and one cell right from the selected cell.

 

You may also like...

2 Responses

  1. Jimmy Benson says:

    In your post, you have:
    “Range(“A2”).Offset(-1,0).Select
    And com­piler reads, move one cell left from A2 , which is A1.”

    I believe this is incor­rect. Offset(-1,0) should tell the com­piler move one cell up, not left.

    Thanks for the post!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: