View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default End of Spreadsheet

My preference is to create a range to seach and then traverse that range...
Something like this

dim rngToSearch as range
dim rng as range

with Sheets("sheet1")
set rngToSearch = .range("A2", .cells(rows.count, "A").end(xlUp))

for each rng in rngToSearch
msgbox rng.address
next rng
end with
--
HTH...

Jim Thomlinson


"Chas" wrote:

Writing a VBA in Excel, how do I know if I am at the last row of data? The
column I am processing may have empty cells. But an adjourning cell will
always have something until the end of rows is reached. Is there an
equivalent EOF or do I examine the adjourning column as I process?