+ Reply to Thread
Results 1 to 5 of 5

Selecting data down to last row.

  1. #1
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Exclamation Selecting data down to last row.

    I am currently compiling multiple worksheets with similar data into one so it is organized. I have a macro that finds the worksheet name I am looking for and copys the range I need. For Example: A2:D25. However if the data goes past row 25 I don't get it all if it goes shorter I have empty cells. How Do I get it to select until the last row of data?

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Selecting data down to last row.

    Use sheets1.Usedrange

  3. #3
    Registered User
    Join Date
    03-01-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Selecting data down to last row.

    Try this for finding the last row of data:

    Please Login or Register  to view this content.

    Make your range as:

    Please Login or Register  to view this content.
    I'm assuming Z as your last column....change as required

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

    Re: Selecting data down to last row.

    You shouldn't need to select,it will slow the process
    Hope that helps.

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

    Free DataBaseForm example

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Selecting data down to last row.

    Hello CJPHX,

    It depends on how you define your last row. If the last row is the last cell in a column that has a visible data then EK1's code is what you should use. If you are defining the last row as any cell with a border, colored background, or formula then use snb's code.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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