PC Review


Reply
Thread Tools Rate Thread

Bottom Cell with VALUE

 
 
Zone
Guest
Posts: n/a
 
      23rd Aug 2007
This finds the last row in the column with anything in it
r=cells(rows.Count,"a").End(xlUp).Row
But, if that cell has a formula in it that returns "", then the statement
returns that row because there is a formula in it. I know I could follow
the statement with something clumsy like
While cells(r,"a")="" r=r-1
But I wonder if there isn't a simpler way. Thanks, James


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      23rd Aug 2007
will only work if the blank cells are all at the bottom of the range...

r = Cells(Rows.Count, "a").End(xlUp).Row
lBlanks = WorksheetFunction.CountBlank(Range("A1:A" & r))
r = r - lBlanks



--
Hope that helps.

Vergel Adriano


"Zone" wrote:

> This finds the last row in the column with anything in it
> r=cells(rows.Count,"a").End(xlUp).Row
> But, if that cell has a formula in it that returns "", then the statement
> returns that row because there is a formula in it. I know I could follow
> the statement with something clumsy like
> While cells(r,"a")="" r=r-1
> But I wonder if there isn't a simpler way. Thanks, James
>
>
>

 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      23rd Aug 2007
Thanks, Vergel.
"Vergel Adriano" <(E-Mail Removed)> wrote in message
news:29138BD3-FECC-4FA6-A428-(E-Mail Removed)...
> will only work if the blank cells are all at the bottom of the range...
>
> r = Cells(Rows.Count, "a").End(xlUp).Row
> lBlanks = WorksheetFunction.CountBlank(Range("A1:A" & r))
> r = r - lBlanks
>
>
>
> --
> Hope that helps.
>
> Vergel Adriano
>
>
> "Zone" wrote:
>
>> This finds the last row in the column with anything in it
>> r=cells(rows.Count,"a").End(xlUp).Row
>> But, if that cell has a formula in it that returns "", then the statement
>> returns that row because there is a formula in it. I know I could follow
>> the statement with something clumsy like
>> While cells(r,"a")="" r=r-1
>> But I wonder if there isn't a simpler way. Thanks, James
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I put my text at the top of the cell instead of the bottom? jbaby7935 Microsoft Excel Setup 1 20th Sep 2009 07:10 PM
how to get a cell on a page to equal the bottom most cell on dif =?Utf-8?B?TGVhcm5pbmcgQXNzaXNzdGFudCBpbiBuZWVkIG9m Microsoft Excel Worksheet Functions 1 24th May 2005 09:50 PM
only last cell on page to have bottom border (cell area outline) =?Utf-8?B?V2lnZ3Vt?= Microsoft Excel Worksheet Functions 1 29th Apr 2005 03:53 PM
format to see bottom of cell =?Utf-8?B?RGFuZyBUcmFu?= Microsoft Excel Discussion 1 23rd Apr 2005 05:09 AM
bottom right cell on screen Stuart Microsoft Excel Programming 4 18th Dec 2003 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:19 PM.