+ Reply to Thread
Results 1 to 4 of 4

VBA tells me I have a Loop without a Do, but I'm not sure where the problem lies.

  1. #1
    Registered User
    Join Date
    12-27-2018
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2013, 2016
    Posts
    25

    VBA tells me I have a Loop without a Do, but I'm not sure where the problem lies.

    Hi all, simple question, I believe. I've written this macro

    Please Login or Register  to view this content.
    And I keep getting the same error: "Loop without Do"

    So I'm assuming that something inside that Do is closing it but I don't know enough about VBA to know what that could be. Could somebody illuminate that for me?

    Thank you very much in advance.
    Last edited by FZappa; 08-30-2019 at 02:41 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,951

    Re: VBA tells me I have a Loop without a Do, but I'm not sure where the problem lies.

    I'm not sure why the compiler is highlighting the "loop without do". What I see is a For Each without a Next. My guess is that, because the For Each is nested inside of the Do...Loop, the compiler is confused as to the source of the error.

    I put a Next CodInd statement just before the Loop Until statement, and the procedure compiled just fine.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-27-2018
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2013, 2016
    Posts
    25

    Re: VBA tells me I have a Loop without a Do, but I'm not sure where the problem lies.

    That certainly was what fixed it. I have a different problem now but I assume I have to post that on a separate thread?

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,951

    Re: VBA tells me I have a Loop without a Do, but I'm not sure where the problem lies.

    Unless the next issue is closely related to this one, then this forum tends to prefer that you start a new topic for each question.

+ 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. Need a VBA func. that tells if a point lies above/below 3D polygon surface
    By gonurvia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2017, 10:41 AM
  2. [SOLVED] True or False if Number Lies Between a Certain Value
    By AtomicDog in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-10-2014, 11:03 AM
  3. Replies: 4
    Last Post: 03-24-2013, 11:15 AM
  4. Replies: 4
    Last Post: 12-14-2011, 03:08 PM
  5. When Cell Value lies between two values?
    By Stirly in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2006, 06:18 AM
  6. Finding the cell in which an object lies
    By F*SH in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-19-2006, 04:33 AM
  7. Cell lies within range
    By Kaval in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2005, 08:05 AM

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