View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Alan Hutchins[_2_] Alan Hutchins[_2_] is offline
external usenet poster
 
Posts: 6
Default Selecting last row?

The previous replies are all ok, but they might not be exact.

I have used the following function for years now, and it ALWAYS give steh
correct result.

I got it from Rob Bovey and then added a few lines

Function Goto_Last(strRange, int_col, int_row)
On Error Resume Next
Application.ScreenUpdating = False
Cells(Cells.Find("*", Range("A1"), , , xlByRows, xlPrevious).Row, _
Cells.Find("*", Range("A1"), , , xlByColumns, xlPrevious).column).Select
If Err.Number < 0 Then MsgBox "No data in sheet"
Application.ScreenUpdating = True
strRange = ActiveCell.AddressLocal
int_col = ActiveCell.column
int_row = ActiveCell.Row
End Function

You just add a line to your macro to call the function, and then use the
data it returns.

--
Alan Hutchins


"edward0380" wrote:


I want to have a macro that will select the cell in the last row in
column A. How do I do that?


--
edward0380
------------------------------------------------------------------------
edward0380's Profile: http://www.excelforum.com/member.php...o&userid=29396
View this thread: http://www.excelforum.com/showthread...hreadid=511077