ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question about "End(xlUp)" property (https://www.excelbanter.com/excel-programming/273424-re-question-about-end-xlup-property.html)

Dave Peterson[_3_]

Question about "End(xlUp)" property
 
I think I'd do something like:

dim NextRow as long

nextrow = range("a65536").end(xlup).row
if isempty(range("A" & nextrow)) then
'do nothing
else
nextrow = nextrow + 1
end if



Terence wrote:

Hi,

I am writing some codes to find out the last non-empty
cell in column A of my worksheet by using the code "Range
("A65536").End(xlUp).Row", then I can write something new
at the next row.
However, if the cell (A1) at row 1 is empty, it doesn't
return 0 but 1. If I write something at the next row, then
it is written to row 2 (cell A2) but leaving cell A1
empty. How should I avoid this problem? Is there any
better coding method?
Thanks a lot in advance!!

Terence


--

Dave Peterson


Terence[_2_]

Question about "End(xlUp)" property
 
Hi,

Thanks a lot!
-----Original Message-----
I think I'd do something like:

dim NextRow as long

nextrow = range("a65536").end(xlup).row
if isempty(range("A" & nextrow)) then
'do nothing
else
nextrow = nextrow + 1
end if



Terence wrote:

Hi,

I am writing some codes to find out the last non-empty
cell in column A of my worksheet by using the

code "Range
("A65536").End(xlUp).Row", then I can write something

new
at the next row.
However, if the cell (A1) at row 1 is empty, it doesn't
return 0 but 1. If I write something at the next row,

then
it is written to row 2 (cell A2) but leaving cell A1
empty. How should I avoid this problem? Is there any
better coding method?
Thanks a lot in advance!!

Terence


--

Dave Peterson

.



All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com