Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Range("a21") .end(xlDown) or .end(xlUp) . offset(1,0) . value

Can anyone help explain this situation;

When I try this statement:

Range("a21").end(xlDown).offset(1,0).value = x the cursor does NOT find the end of the list in column "A" to place the value in the proper cell.

When I try this statement
Range("a21").end(xlUp).offset(1,0).value = x the cursor DOES find the end of the list in column "A"to place the value in the proper cell.

This puzzles me to not end.

Thanks for any enlightenment


JDB
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Range("a21") .end(xlDown) or .end(xlUp) . offset(1,0) . value

JDB wrote :
Can anyone help explain this situation;

When I try this statement:

Range("a21").end(xlDown).offset(1,0).value = x the cursor does NOT find the
end of the list in column "A" to place the value in the proper cell.

When I try this statement
Range("a21").end(xlUp).offset(1,0).value = x the cursor DOES find the end of
the list in column "A"to place the value in the proper cell.

This puzzles me to not end.

Thanks for any enlightenment


JDB


Using End basically does the same thing as using the Ctrl and Down [or
Right] arrow keys. So.., if there's any blank cells between 'A1" and
"A21" then using End(xlDown) sets the cell ref one row above the blank
cell. The correct way to find the last row in a column is to start at
the bottom (ie: Cells(ActiveSheet.Rows.Count, 1).End(xlUP), which in
your case might be "A21". Otherwise, you could get the next row by
simply using Range("A21").Offset(1) to ref cell "A22".

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Destination:=.Cells(.Rows.Count, "A").End(xlUp).Row + 1 J.W. Aldridge Excel Programming 5 May 6th 09 09:10 PM
Whats wrong with this? MyWBAccRep.Sheets("Volumes").Cells.Find("latest").Copy.Offset(0, Simon[_2_] Excel Programming 2 August 11th 08 01:29 PM
Cells(Rows.Count, "b").End(xlUp).Row Kate[_2_] Excel Programming 1 May 25th 06 04:31 PM
inalRow = Range("A65536").End(xlUp).Row ciba1234[_2_] Excel Programming 2 September 15th 05 10:28 PM
S1.Range("D65536").End(xlUp).Select Rick[_19_] Excel Programming 6 January 13th 04 01:24 AM


All times are GMT +1. The time now is 09:11 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"