Home > Articles > Home & Office Computing > Microsoft Applications

From the author of 

Use the CurrentRegion Property to Select a Data Range

CurrentRegion returns a Range object representing a set of contiguous data. As long as the data is surrounded by one empty row and one empty column, you can select the table with CurrentRegion:

RangeObject.CurrentRegion

The following line selects A1:D3 because this is the contiguous range of cells around cell A1 (see Figure 3.5):

Range("A1").CurrentRegion.Select
Figure 3.5

Figure 3.5. Use CurrentRegion to select a range of contiguous data around the active cell.

This is useful if you have a table whose size is in constant flux.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.