View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Finding the next empty cell.

Assume column A
Cells(1,1).End(xldown)(2).Value = "String"

If A1 and or A2 could be blank

Dim rng as Range
if isempty(Range("A1")) then
set rng = Range("A1")
elseif isempty(Range("A2")) then
set rng = Range("A2")
else
set rng = Range("A1").End(xldown)
End if
set rng = rng(2)

if there will never be data below the "next empty cell"

set rng =cells(rows.count,1).End(xlup)
if not isempty(rng) then _
set rng = rng(2)



--
Regards,
Tom Ogilvy

"Unknown_User " wrote in
message ...
Hi all,

A successful night so far as my first question was answered within
seconds!

I want to populate the next available empty cell in a column with the
results of a VB script that returns a string.

Can anyone tell me how to locate the next empty cell?

Thanks!


---
Message posted from http://www.ExcelForum.com/