View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Find last non-blank cell in range

From your example (column A):

=ADDRESS(MATCH(9.99999999999999E+307,A:A),1) will return the address of the
last used cell IF IT IS A NUMBER

Hence if the above formula is in B1, then:
=INDIRECT(B1) will return the value in that last used cell
--
Gary''s Student - gsnu200753


"Eric" wrote:

Thanks for the suggestion.

I'll use a macro if I have to, but what I was hoping to find is a function,
or a series of functions. For example, LAST_NONEMPTY_CELL_VAL(A:A) = 12345,
or LAST_NONEMPTY_CELL_ADDR(A:A) = "A124". Something like that.


"Gary''s Student" wrote:

Select the range and:

Sub findit()
For Each r In Selection
If IsEmpty(r) Then
Else
s = r.Address
End If
Next
MsgBox (s)
End Sub



--
Gary''s Student - gsnu200753


"Eric" wrote:

How can I find the last (meaning bottom, or right-most) non-empty cell in a
range?

Thanks.