#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default End(xlUp)

Hello,

Please could someone explain how End(xlUp) works?? I have also seen
End(xlUp) (2) as well, again I have no idea what it means. I have
searched this group and the various sites but I could not get any
satisfactory answers.

Regards,

Bharesh

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default End(xlUp)

Hi Bharesh,

End function is pretty simple, same thing that happens when you press
ctrl key and then up arrow key. (right, left and down also work.)

Lets consider, you have a data where you want to add some more stuff at
the end. How will you get to the Last cell in column A.

Here is how...
Sub xlups()
Range("A65536").End(xlUp).Select
End Sub

Range("A65536") is the last cell in column A.. this is very useful when
you want to create a database and add / delete records from the same.

the (2) is for offset... for example you want to select the cell in
column C on the next row of the last used row in column A, you will use

Range("A65536").End(xlup)(2,3).Select

Note... the offset works a bit differently here in this function, as
(1,1) is the "SAME" cell unlike the normal offset function.

Hope this helps... if you need any more help, mail me directly.

~Yogendra

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default End(xlUp)

End(xlUp) simply looks for the end cell, looking up the column relative to
where the start point is. That start point can be a specific cell (B1000),
or more dynamic (Cells(Rows.Count,"B"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"m4nd4li4" wrote in message
ups.com...
Hello,

Please could someone explain how End(xlUp) works?? I have also seen
End(xlUp) (2) as well, again I have no idea what it means. I have
searched this group and the various sites but I could not get any
satisfactory answers.

Regards,

Bharesh



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default End(xlUp)

Hello,

(2) is shorthand for the range's Item Property. See the following:

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

It's actually a 2-d reference, but you can omit the 2nd argument.

Like most MS shipped classes, it's 1-based, so (1,1) refers to the top-left
cell in the reference, 2 moves down a row, 0 actually moves back a row, etc...

An exception to 1-based class rule would be in Access:

MsgBox DBEngine.Workspaces.Item(0).Databases.Item(0).Name

Or:

MsgBox DBEngine(0)(0).Name

The Range is an odd bird, most collections as we know them are 1-d...

Regards,
Nate Oliver
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
Understanding .End(xlUp) (1,1) Dennis Excel Discussion (Misc queries) 4 April 4th 23 02:13 PM
End(xlUp) question CoolBusiness Excel Discussion (Misc queries) 4 March 26th 09 07:07 PM
problem with .end(xlUp).row [email protected] Excel Discussion (Misc queries) 4 December 29th 06 01:24 PM
Stupid End(xlup) problem Steph[_3_] Excel Programming 4 August 23rd 04 11:35 PM
XLUP FInd Error Todd Huttenstine Excel Programming 3 August 12th 04 07:52 AM


All times are GMT +1. The time now is 09:48 AM.

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

About Us

"It's about Microsoft Excel"