+ Reply to Thread
Results 1 to 3 of 3

Loop skipping random rows for no reason at all

  1. #1
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Loop skipping random rows for no reason at all

    Please take a look at the book that I have attached.

    My sub is supposed to take the values from Sheet1 and paste them into 16x10 tables on Sheet2. However, for some odd reason, the loop is skipping some rows. If you take a look, there are 2184 values in Sheet1, but only 1368 end up in Sheet2...SKUs such as 518166,518167,510573,513746,513752 are just being skipped for no reason.

    I would really appreciate it if someone took a look and helped me solve this.
    Attached Files Attached Files
    Last edited by GeorgY; 04-16-2009 at 01:49 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Loop skipping random rows for no reason at all

    Hi

    Have a look at
    Please Login or Register  to view this content.
    What you are doing is stepping 8 for each iteration, but you are only using 5 of those 8 to get / paste data.

    If you take your first row being 2, then the first loop will cover the rows 2-10. However, you are only outputting rows 2-6 with rows 7-9 not being actioned. Taking that further the some of the items you nominate are in rows 871 and 872 (518166 and 518177). Using the maths 2+108*8 you have a starting row of 866 for a block of 8 items. So rows of data would be 886-870 and if you look at your output, the associated items are output. The missing items are in the ignored rows of 871, 872 and 873.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Loop skipping random rows for no reason at all

    Good catch! Thank you very much for pointing that out..sometimes I get frustrated and miss out on little things like that. All I had to do is change the Step to 5.

    Thanks again!

+ 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