PDA

View Full Version : Last non-blank cell in a row or column



arash
03-06-2009, 03:23 AM
Hi,

I am using following command to find a last non-blank cell in a row:
Range("A1").End(xlToRight).Select It works fine most of the time. But sometimes, the result is unexpected.
For instance, when I delete the values in the row, it gets confused.

Anyone has a better solution for fiding the last non-blank cell?

Thanks,

Arash

venkat1926
03-07-2009, 06:41 PM
try


cells(1,columns.Count).end(xltoleft).select

arash
03-09-2009, 01:19 AM
Thanks venkat.

Cheers.