+ Reply to Thread
Results 1 to 3 of 3

Selecting last row

  1. #1
    mhayli
    Guest

    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. #2
    halimnurikhwan@yahoo.com
    Guest

    Re: 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. #3
    Kevin McCartney
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1