+ Reply to Thread
Results 1 to 4 of 4

How to make a loop stop running when two values get close to each other instead of equal

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Office 97
    Posts
    43

    How to make a loop stop running when two values get close to each other instead of equal

    I am pretty much VBA ignorant. A kind gentelman helped me make a loop a few months back for a brewing spreadsheet that I made. The loop is fucntional, but I would like to modify it if possible. The loop is set up to make two cell values equal each other by adjusting the value of a third cell. To accomplish this 100% of the time, I had to set the loop to make adjustments in increments of .0001. The problem is, sometimes it can take quite a while for the computation to complete. If I set the loop to adjust in increments of .001, it is always able to get the two values in question within .01 of each other and the computations run a lot faster. For my purposes, a difference of .01 is insignificant. Is there a way to make the loop stop running when the two values get within .01 of each other istead of having to make them equal? Here is the coding I am working with.

    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: How to make a loop stop running when two values get close to each other instead of equ

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

  3. #3
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Office 97
    Posts
    43

    Re: How to make a loop stop running when two values get close to each other instead of equ

    That makes perfect sense. I'll give it a try. Thanks.

  4. #4
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Office 97
    Posts
    43

    Re: How to make a loop stop running when two values get close to each other instead of equ

    Works perfectly, that you so much.

+ 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