View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Finding the first empty cell in a column

Hi Tegger,

I found a problem though in that the exported XML workbook for
some reason have a few rows within the customer transactions that
are blank so End(xlDown) does not go to the last record. I am going
to have to find some other method to find the final entry in the table.


Try:;

Set rng = Cells(Rows.Count, "A").End(xlUp)(2)


---
Regards,
Norman



"Tegger" wrote in message
...
The expression:

Set rng = Range("A1").End(xlDown)(2)


is an abbreviated version of:

Set rng = Range("A1").End(xlDown).Item(2, 1).

Chip Pearson hosts an excellent discussion, written by Alan Beban, of
this
method at:

http://www.cpearson.com/excel/cells.htm

The above expressions are equivalent to:

Set rng = Range("A1").End(xlDown).Offset(1, 0)


Ahhh... Now i understand, you and Alan explained it perfectly. I found a
problem though in that the exported XML workbook for some reason have a
few
rows within the customer transactions that are blank so End(xlDown) does
not
go to the last record. I am going to have to find some other method to
find
the final entry in the table. Thx for your help, knowing how Item works
seems like it will be very usefull.