View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default IsEmpty on a range/array

One way:

Dim rLastCell As Range
Set rLastCell = Range("A" & Rows.Count).End(xlUp)


In article ,
"benb" wrote:

I need to find the last row of a column that still contains data. I cannot
use Do While Not IsEmpty (or something similar) because there are blank cells
mixed into the column. The best solution I can come up with is finding the
cell at which the 20 or so cells above contain data and the 20 or so cells
below are empty. The problem: IsEmpty does not seem to work in evaluating a
range. How can I evaluate if Cells(1,1) to Cells(20,1) contain data while
Cells(21,1) to Cells(40,1) are empty?