+ Reply to Thread
Results 1 to 6 of 6

Thread: Last used row

  1. #1
    Valued Forum Contributor
    Join Date
    06-06-2007
    Posts
    231

    Last used row

    Dear sir,with best regards,i need your help by a code that will take me to the last used row from my worksheet , row D which contains the no. of invoice.
    Many thanks in advance.
    Last edited by tofimoon4; 12-10-2011 at 04:46 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-06-2007
    Posts
    231

    Re: Last used row

    Dear sir, with my apology i mean (my worksheet ,column D ).

  3. #3
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Last used row

    Hi tofimoon4,

    If you have the data filled in column D and you want to know the last used row which has the data, use below code

    i = Range("d65536").End(xlUp).Row
    Regards,
    DILIPandey

    < click on below 'Star' if this helps >
    Last edited by dilipandey; 12-10-2011 at 04:34 AM. Reason: coding structure applied
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  4. #4
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Last used row

    Sub dfd()
    Hi tofimoon4,

    To get to the last cell in column D which was used previously but now is blank, you can use below code :-

    
    Range("d1").SpecialCells(xlCellTypeLastCell).Select
    Complete macro code for both the cases, including the one which I had mentioned in my previous email, is given below:-

    sub lastrow()
    
    Range("d65536").End(xlUp).Select
    Range("d1").SpecialCells(xlCellTypeLastCell).Select
    
    End Sub
    Regards,
    DILIPandey

    < click on the below 'Star' if this helps >
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  5. #5
    Valued Forum Contributor
    Join Date
    06-06-2007
    Posts
    231

    Re: Last used row

    Dear sirs,many thanks for help.

  6. #6
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Last used row

    You are welcome tofimoon4.

    Cheers


    Regards,
    DILIPandey

    < click on below 'Star' if this helps >
    DILIPandey
    +919810929744
    dilipandey@gmail.com

+ 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.2.0