Thread: End(xlUp)
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Yogendra Yogendra is offline
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