Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
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
Selecting every 4th row Cindy Excel Discussion (Misc queries) 3 January 20th 10 09:46 PM
Selecting the next row up or down?????? Bob Excel Discussion (Misc queries) 3 April 9th 09 12:08 PM
SELECTING LAST ROW da Excel Discussion (Misc queries) 10 August 2nd 08 01:11 AM
VBA - Selecting a Row Elise148 Excel Discussion (Misc queries) 5 June 12th 07 04:29 PM
Selecting The Last Row Minitman[_4_] Excel Programming 15 July 25th 05 03:11 AM


All times are GMT +1. The time now is 10:05 PM.

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

About Us

"It's about Microsoft Excel"