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: Refer to Cells by Using Shortcut Notation

You don’t have to type Range every time, you have short­cut for that, ‘Brackets’.

Short­cut for refer­ring one cell.

Worksheets(“Sheet1”).[G5].Interior.ColorIndex = 45

Instead of using Range(“G5”), you can use [G5].

Short­cut for refer­ring range of cells.

Worksheets(“Sheet1”).[E3:F5].Value = 4

Instead of using Range(“E3:F5”), you can use [E3:F5].

Short­cut for refer­ring more than one cell.

Worksheets(“Sheet1”).[G5,F9,H6].Interior.ColorIndex = 45

Instead of using Range(“G5”,”F9”,”H6”), you can use [G5,F9,H6].

 

 

You may also like...

2 Responses

  1. Dinesh says:

    Excel­lent. Well explained. Short and sweet.

  2. sumitjain says:

    Thanks Dinesh .

Leave a Reply

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

%d bloggers like this: