LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 'Do Until...' Restart

Hi All,
Thanks for all the replies - but maybe I should start from scratch and
explain the question in, hopefully, a clearer way [ sorry if I confused
everyone]

In A1 I have '=Countif(B1:B500,15)'

The integer values in cells B1:B500 get incremented with each sheet recalc
due to random functions elsewhere in the sheet and therefore A1 is
incremented randomly with each recalc.

The macro is required to recalculate the sheet until A1 = 'exactly' 100. -
i.e when there are exactly 100 cells in B1:B500 with a value of 15.

So I wrote

Do Until Range("a1") = 100
' Do Stuff
Calculate
Loop

The problem is that A1 can be incremented in irregular steps - e.g. from 1
to 2 to 6 etc. and from 93 to 94 to 99 to 102 etc. and therefore a1=100 is
never true - hence a permanent loop

But I need to restart the Do Until loop if and when A1 exceeds 100.

[BTW I can handle the resetting of the values in B1:B500 with a small
routine between 'Loop' and 'End']

Thanks again
Jack







 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restart a code upon vbno FARAZ QURESHI Excel Discussion (Misc queries) 2 March 2nd 09 07:51 AM
HOW TO RESTART COUNT FORMULA tgcali Excel Discussion (Misc queries) 3 April 21st 08 11:26 PM
HOW TO RESTART COUNT FORMULA akphidelt Excel Discussion (Misc queries) 0 April 21st 08 10:56 PM
Won't restart after close Markk Primack[_2_] Excel Discussion (Misc queries) 3 September 2nd 07 02:27 PM
Automatic Updates should not be able to restart your computer when junebug Excel Discussion (Misc queries) 0 April 15th 05 10:52 PM


All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"