View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] halimnurikhwan@yahoo.com is offline
external usenet poster
 
Posts: 113
Default Selecting last row

Hi mhayli,

Try this :
Sub TEST()
Dim ENDs As Object, ARow as Integer
Set ENDs = Range("A65536").End(xlUp) 'from the bottom chage
"A65536" to _ range you want to.
ARow = ENDs.Row
msgbox ARow ' here is the row
End Sub


mhayli menuliskan:
I would like to write a macro in which a worksheet is firstly unprotected,
then the last row in the data entry field is copied then the row is "insert
copied row". The last data row may or may not have data in it and the row
number is variable. However, the last row into which data is entered is
always above a row that has "average" in the first column of that row.

Can tell me how I would write code to select the row above the "average" row??

Thanks.