+ Reply to Thread
Results 1 to 5 of 5

Issue: Selects empty cells beyond last data cell

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Issue: Selects empty cells beyond last data cell

    Hi,

    I am trying to do a random sort and pull values from column A. The amount of data in that column will change each time I use this template spreadsheet.

    When my loop does the pull it selects a couple of empty cells past the last cell of data. How do I correct that? Is it my iRange? Below is my code:

    Please Login or Register  to view this content.
    Last edited by VPeters; 02-02-2012 at 04:29 PM.

  2. #2
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Issue: Selects empty cells beyond last data cell

    Psst. Put [ code ] tags around your macro there before a mod comes in and beats you with a stick. We're not actually allowed to answer your question until you're not breaking any of the forum rules.

  3. #3
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Issue: Selects empty cells beyond last data cell

    Right of Way Flexibilities Project List (2).xlsm

    Hi,

    I am trying to do a random sort and pull values from column A. The amount of data in that column will change each time I use this template spreadsheet.

    When my loop does the pull it selects a couple of empty cells past the last cell of data. How do I correct that? Is it my iRange? Below is my code:

    Please Login or Register  to view this content.
    Last edited by VPeters; 02-02-2012 at 04:26 PM. Reason: Adding file

  4. #4
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Issue: Selects empty cells beyond last data cell

    Try changing your 'iRange =' to

    Please Login or Register  to view this content.
    That will assign the row number of the last cell in the column with any data in it.

  5. #5
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Issue: Selects empty cells beyond last data cell

    Making that change to the iRange pulls more blank cells than the original iRange

+ 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