View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
tig tig is offline
external usenet poster
 
Posts: 3
Default Find First Row where "value" = ""

KC Rippstein wrote:
First off, why don't you just set up your range of existing data as a list?
Then when you need to add a new entry, you just add an entry to the list and
any formulas above it (like the one in column X) are automatically applied
to the new entry. Populating all 65,536 rows is not efficient.

From an Oct 2004 posting by Michael Bauer:
This sample finds the first cell in column 24 from buttom up that is *not*
empty. The next cell then is empty of course.

dim rn as excel.range

set rn=Worksheets.Columns(24).Find("*", , xlValues, xlWhole, xlByRows,
xlPrevious)
if not rn is nothing then
set rn=rn.offset(1,0)
else
' the last row (65536) isnīt empty
endif

"tig" wrote in message
ups.com...
I need to find the first row in column X where the value = "". By
value I mean the value of the formula. I have a formula in 1 through
65536 as I don't know how many rows the user is going to need from one
day to the next.

Any ideas??


TIA

Thanks for the post KC. I think that will do it. I'm interested in
learning a little more about your range as a list idea. The column
that I'm actually going after is column "D". I just used X as a
variable.

My formula in D2:D65536 is IF(C# = "", "", "This, that and whatever")

One day the user may import 500 records another day they might have
5000. In your idea, are you saying don't populate the "D" cell with
the formula if the respective "C" cell is empty. I'm not sure I
understood your meaning, but I'm very interested in making this process
more efficient.

Could you give me some additional detail on your idea and/or some code
to start with?

Thanks again for the help.