Set rSomething = Range(top left cell, bottom right cell)
You have a set of records in a worksheet that you want to process.
A worksheet with records in it.
An object that you can loop across.
- Dim rGoatDataTable As Range
- 'Set up the Range object.
- Set rGoatDataTable = Range(Cells(3, 1), Cells(3, 1).End(xlToRight).End(xlDown))
This creates a
Range object. The upper left cell is C1. The lower right cell is however far you get until you run out of data (find an empty cell) to the right and below.
See the Worksheet tables: Ranges lesson for more.