+ Reply to Thread
Results 1 to 5 of 5

A Loop not completing

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    Hampton, VA
    MS-Off Ver
    Excel 2010
    Posts
    2

    A Loop not completing

    I have a macro that will automatically update my ACL files based on how many variables were derived from each DIV
    For example, if there is a line with <xxxxx#_IP> and there are 5 variables derived from<xxxxx#_IP>, the line will be repeated 5 times (once for each variable).
    The number 5 is changeable. Having issues with higher repeated times, like 20-30. It is like the loop starts but does not have enough time to finish before the macro continues to the next command. I was thinking off adding a delay after each loop command I have attached a portion of my macro. I need assistance in adding a delay in the loop. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: A Loop not completing

    Have you tried stepping through the picture code to see what's happening?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-17-2013
    Location
    Hampton, VA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: A Loop not completing

    Yes
    it gives the information then goes off in a string and shows nothing for several lines then goes into the next command. it seems to time off. This is why i thought of using a delay in the macro to give it enough time to download all the data needed then continue.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: A Loop not completing

    What do you mean download data?

    There's nothing in that code that is doing that.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: A Loop not completing

    1. Why did you not post the code directly to the forum?
    Use code tags around code.
    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    2. Why did you not post a sample workbook with enough sample data to test the macro?
    Ben Van Johnson

+ 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