#1   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default Rowkount

I am trying to find the last row in a spreadsheet that contains data. The
range.count function stops when it hits a blank cell? Is there a quick and
dirty way to find the row# (or address) of the last cell in a worksheet that
contains data without worrying about blank cells?
--
Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Rowkount

Try something like:

Dim strLastCell as String
strLastCell = Activesheet.Range("A65536").End(xlUp).Address

msgbox strLastCell

You can also change "Address" to "Row" if preferred. To get the next
available cell below the last used cell use:

Dim strLastCell as String
strLastCell = Activesheet.Range("A65536").End(xlUp).Offset(1, 0).Address

Hope this helps.


"Ray" wrote:

I am trying to find the last row in a spreadsheet that contains data. The
range.count function stops when it hits a blank cell? Is there a quick and
dirty way to find the row# (or address) of the last cell in a worksheet that
contains data without worrying about blank cells?
--
Ray

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Rowkount

This will count the last row with data and ignore blank cells in between.

LastRow = Cells(Rows.Count, 1).End(xlUp).Row

(where 1 is the first column. to check LastRow in column C you enter 3)

Glen

"Ray" wrote in message
...
I am trying to find the last row in a spreadsheet that contains data. The
range.count function stops when it hits a blank cell? Is there a quick and
dirty way to find the row# (or address) of the last cell in a worksheet
that
contains data without worrying about blank cells?
--
Ray



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



All times are GMT +1. The time now is 02:36 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"