Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default End of Spreadsheet

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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
link a local spreadsheet to a network shared spreadsheet Leo Setting up and Configuration of Excel 1 March 21st 08 10:37 AM
Transmitting data from a server spreadsheet to a client spreadsheet gloryofbach Excel Programming 3 October 27th 05 11:23 AM
conversion of MS Works Spreadsheet to Excel 2002 Spreadsheet Kellie Excel Discussion (Misc queries) 1 March 24th 05 06:31 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


All times are GMT +1. The time now is 03:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"