Monday 20 May 2013

Difference between Cells and Range in Excel VBA Macro


Cells is used to refer to Single cell. While we use Range to refer to more than one cell.

Example -

 Worksheets("Sheet1").Cells(2, 3).Value = 20
In Above example, We are writing 20 into C2 cell.

Using Range object, Same thing can be coded like below -

 Worksheets("Sheet1").Range("C2").Value = 20

This is the difference between cells and Range object in VBA Excel Macro.

No comments:

Post a Comment

Popular Posts

Search This Blog