Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Object doesn't support this property or method" in Excel 2003 rhiski12 Excel Discussion (Misc queries) 3 November 24th 08 03:58 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
VBA error: "object doesn't support this property or method" Dave F Excel Discussion (Misc queries) 2 April 23rd 07 06:04 PM
"Disk is Full" add-on question to "Can't reset last cell" post tod [email protected] Excel Discussion (Misc queries) 0 January 22nd 07 02:32 AM
Question about "End(xlUp)" property Chip Pearson Excel Programming 0 August 4th 03 02:57 AM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"