Run Macro until a condition is met

T

tx12345

Hi

Let's say I have a little macro that generates a short random row of
numbers. In another cell there is a formula that sees if a particular
condition is met with the lately created string by the marco.

The next item of business is to store the string *if* the condition is
met.

But let's say I need my 'storage' list to have at least 20 rows of
qualified strings, assuming not every string evaluated will qualify for
storage.

Is there a way to tell the macro "keep going until there are 20 rows of
data"?

Thx


tx
 
T

tx12345

OK, i've got:

Sub store

Do counter = 20

Application.Run "xzy!store1"

loop

end sub

but it runs on into infinity. any way to tell it to stop when Cell C1
for example, says 20?

thx

t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top