+ Reply to Thread
Results 1 to 5 of 5

How to find last row

  1. #1
    Registered User
    Join Date
    09-26-2007
    Posts
    26

    How to find last row

    Here is what I need help with...

    I want to use VBA to determine the range of used cells on a worksheet so that I can then insert some formulas into the cells. I have used the following code to find the last row. But because I have an array formula in another sheet that references this sheet, I am getting the range as defined in the array formula.

    Please Login or Register  to view this content.
    Thanks,
    js999

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    js-

    Try this code for the last used row:
    Please Login or Register  to view this content.
    HTH

    Jason

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Here's another

    Please Login or Register  to view this content.
    You could make this a Function & use it like this

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    09-26-2007
    Posts
    26
    Thanks for the responses jasoncw and royUK.

    I ended up using the following code and it works nicely.

    Please Login or Register  to view this content.
    Thanks,
    -js999

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    js-

    Just a FYI, that will be just fine to find the last cell in a particular column. However, if you need to find the overall last row (for all columns), use the code I posted above.

    Jason

+ 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