Excel: use macro to do 'step function'?

Joined
Dec 8, 2007
Messages
1
Reaction score
0
Hi,
if i have a value in cell A1 = 0.5, then i have another value in cell B1 = 9, i would like to increase A1 value by 1 everytime until it get closer to B1 value, but less than B1 (A1/B1 <1 ).
I would like to use macro (properly by clicking on a button) to do a 'step function' which is
step 1 - increase the value in A1 by 1
step 2 - compare new A1 value with B1 value, if A1/B1 < 1, then back to 'step 1', again increase the A1 value, until A1/B1> 1, then 'put' the new A1 value in cell A1, the new A1 value should be the last value which give A1/B1<1 ( 8.5/9 < 1 ).
how can i achieve this? please advice.
 

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