+ Reply to Thread
Results 1 to 5 of 5

Loop fails on 2nd iteration

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Loop fails on 2nd iteration

    My loop works for the first J but fail on the 2nd iteration and I can not figure out why

    Thanks


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

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Loop fails on 2nd iteration

    Capson,
    Your dimension
    Please Login or Register  to view this content.
    No error, but I do not know what are you trying to do

  3. #3
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Loop fails on 2nd iteration

    I am tring to get the column range for each header name, then act on that range then clear that range and act on the next range gotten from the header

  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Loop fails on 2nd iteration

    I am tring to get the column range for each header name, then act on that range then clear that range and act on the next range gotten from the header name

    I can get it for the first loop J=0 I have:
    Please Login or Register  to view this content.
    Becomes
    Please Login or Register  to view this content.
    But For J=1 I get:
    Please Login or Register  to view this content.
    Should Become
    Please Login or Register  to view this content.
    But I get Subscript out of range for MsgBox arrData(1, CN(1)) = "Where"

    So I do not think I am getting the range for the loop right after the first iteration or the Erase maybe is not being appled properly?

    Thanks

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Loop fails on 2nd iteration

    Hi capson,
    try
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Loop fails on 2nd iteration

    Thanks nilem, I can't believe I did not see that!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Continue next iteration of For loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2013, 02:09 AM
  2. Loop Array Iteration and Processing
    By Bigced_21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2010, 11:16 AM
  3. Selection not updating after 1st iteration in a For Each loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2009, 09:19 PM
  4. For Loop STOPS at Random Iteration!
    By wjoc1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2007, 09:58 AM
  5. Advancing to the next iteration of a loop?
    By Maury Markowitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2005, 01:06 PM

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