+ Reply to Thread
Results 1 to 3 of 3

Help With Indefinite Loop

  1. #1
    Registered User
    Join Date
    03-21-2010
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    90

    Help With Indefinite Loop

    I have a For loop that does exactly what I need it to do. However, I think in the future the number of cells(account numbers) will increase/decrease. I will like for the code to loop until the cell in row 1 = 0 or has the word total in it. Here is my current code.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Help With Indefinite Loop

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Help With Indefinite Loop

    patel45, this is the right idea but there is an error in the logic, plus it does not compile. Using "Or" here means that no matter what value is in the cell, it will either be not 0 or not "total", therefore creating an infinite loop. You need to use And here. Also a parenthesis is missing so it doesn't compile. I suggest that at a minimum you compile code before posting (sometimes is it not possible or practical to test it).

    Note my change in red:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Indefinite number of loops
    By catalinand in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2012, 09:57 AM
  2. =IF() statement with indefinite test value
    By countzero in forum Excel General
    Replies: 6
    Last Post: 10-13-2011, 03:40 PM
  3. Replies: 7
    Last Post: 11-17-2010, 01:00 PM
  4. indefinite loop
    By losmi8 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2010, 10:01 PM
  5. Macro Help - Indefinite Rows
    By piano.lisa in forum Excel General
    Replies: 3
    Last Post: 08-16-2006, 12:50 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