View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default How do i find last not empty cell in a range

Hi,

There is a problem here - C10 is the last row with a non empty cell but
column E is the last column with a non empty cell. And what do you want to
do if C10, E10 and A10 are all non empty.

The formula for the last non-empty cell in a specific column is

=ADDRESS(MAX((B1:B16<"")*(ROW(B1:B16))),COLUMN())

This assumes you are putting the formula into the same column as the cells
you are checking. If not change the last argument to read COLUMN(B1)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"excelent" wrote:

My senario (xl2003)
B3,B4,B4 holds an X
C5,C6,C8,C9,C10 holds an X
E4,E5,E6,E7 holds an X
and nothing more on that sheet

Is there a formula that return's a cell-address C10 (last not empty)

And how to do the same in VBA
i no about selection.specialcell.xllast to find row 10
and now i do a loop thru rng A10 to F10
but is there another smart way ?