Find the end of a data set

Keywords: 
Situation: 

The number of items in a data set varies. Maybe 502 one day, and 534 the next. You want to find the number of items.

Actions: 

Use a Do loop and an index variable. Check cells one by one, until there's an empty cell.

Explanation: 

Here's some code:

  1. rows = 0
  2. Do While Cells(rows + 1, 1) <> ""
  3.     rows = rows + 1
  4. Loop
You can add error checking code as well.