Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting last row
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting last row
Dim rge as Range set rge = activesheet.cells.SpecialCells(xlCellTypeLastCell) HTH KM "mhayli" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting every 4th row | Excel Discussion (Misc queries) | |||
Selecting the next row up or down?????? | Excel Discussion (Misc queries) | |||
SELECTING LAST ROW | Excel Discussion (Misc queries) | |||
VBA - Selecting a Row | Excel Discussion (Misc queries) | |||
Selecting The Last Row | Excel Programming |