Chapter 11. Defining Ranges
Using the Range Property
When working in Excel, a lot of the work that you do involves ranges. You can define a range by using the Range
property. Defining a range creates a Range
object, which can be a single cell, a column, a row, or a group of cells.
If you use the range property without an object qualifier, Excel assumes you are referencing the active sheet. If you apply the Range
property to a range object, the property is relative to the object. For example, the code Range("B11:D11").Formula = "=Sum(B6:B10)"
sums in a relative fashion.
You can use two syntax forms with the Range
property. The first form requires two parameters: Cell1
and Cell2
. This form references the upper left corner of the desired range with ...
Get Excel® Programming: Your visual blueprint™ for creating interactive spreadsheets now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.