+ Reply to Thread
Results 1 to 4 of 4

Re-Find Last Row in Spreadsheet while Loop is being executed and data grows

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re-Find Last Row in Spreadsheet while Loop is being executed and data grows

    The code I have sorts, filters, and groups like items. The issue I am having is the finalrow declaration before the beginning of the For loop sets the final row of the data as what it is before the loop runs. While the loop runs, it inserts blank rows in between the grouped items. This causes the dataset to get spread across more and more rows. The problem is because of the initial declaration of where that last row is, it won't sort or filter anything past that row. How do I get it to re-calculate the last row of data as the program executes? I've tried a few things, like inserting the finalrow declaration in to the If Then loops, but nothing has worked right so far. Thanks!


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Re-Find Last Row in Spreadsheet while Loop is being executed and data grows

    Try with this small change:

    Please Login or Register  to view this content.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Re-Find Last Row in Spreadsheet while Loop is being executed and data grows

    hi nickv02, can you post original data sample and result you need to obtain?

  4. #4
    Registered User
    Join Date
    05-24-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Re-Find Last Row in Spreadsheet while Loop is being executed and data grows

    Actually Pichingualas' response worked perfect. Everything sorts correctly now.

+ 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