View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default automatically finding the first empty cell

Hi Markus

firstEmptyCell = Range("B15").End(xlDown).Offset(1,0).Address

returns the address of that empty cell. But beware. it throws an error if
B16 is empty, so best to test for that explicitly and if so, bypass that
statement.

--
HTH

Bob Phillips

"Markus Scheible" wrote in message
...
Hi newsgroup,

I hope you can help me with some VBA challenge:

I do have a range named "demand" starting at "B15" and ending somewhere
variably - it has one column and around 800 rows...

My problem is that I need to know which cell of the range is the first

empty
cell - therefore it would be perfect if excel can give me the relative
reference, so to say : the xxxth cell counted from the top cell is

empty...

Does anyone know a possible solution?

Of course I could use a loop but it would be very bad because the macro is
long enough and if he checks every cell it would take some more minutes...
and time is money ;o)

Very heavy thanks in advance and best regards,


Markus