realtoast
New Member
- Joined
- Nov 24, 2015
- Messages
- 47
- Office Version
- 365
- Platform
- Windows
- MacOS
- Mobile
- Web
I have need to create a for next loop that repeatedly adds .00000000000001 to the value of a cell until another cell = 0.
For example, cell B2 is a single value that changes many cells through out a spreadsheet. The initial value of B2 is 1.0420229207198.
Another cell, A2, is affected by the value in B2, as well as another User Input cell, A3. The goal is to, after User input in A3, adjust B2 +/- until A2 is returned to 0. I would like a for loop that adds or subtracts .0000000000001 (13 decimals) to the beginning value of B2 until A2 reaches 0.
When user changes the input value in A3, the result in A2 changes, but B2 remains static. So the loop would incrementally nudge B2 until the result in A3 is back to 0.
I am able to use Solver, easily enough, to do all the above. But, my customer's Excel is throwing an error and he's not able to use Solver. So I need a VBA method to do the same.
Note, there are many dozens of linked formulas in the algorithm, with many variables and many other user input cells. So, this is not merely a math problem, as the initial value of B2 can change from User input in any one of the other cells. But the factor in B2, whatever that may be, can be manipulated to bring A2 to 0.
Thanks for any input!
R
For example, cell B2 is a single value that changes many cells through out a spreadsheet. The initial value of B2 is 1.0420229207198.
Another cell, A2, is affected by the value in B2, as well as another User Input cell, A3. The goal is to, after User input in A3, adjust B2 +/- until A2 is returned to 0. I would like a for loop that adds or subtracts .0000000000001 (13 decimals) to the beginning value of B2 until A2 reaches 0.
When user changes the input value in A3, the result in A2 changes, but B2 remains static. So the loop would incrementally nudge B2 until the result in A3 is back to 0.
I am able to use Solver, easily enough, to do all the above. But, my customer's Excel is throwing an error and he's not able to use Solver. So I need a VBA method to do the same.
Note, there are many dozens of linked formulas in the algorithm, with many variables and many other user input cells. So, this is not merely a math problem, as the initial value of B2 can change from User input in any one of the other cells. But the factor in B2, whatever that may be, can be manipulated to bring A2 to 0.
Thanks for any input!
R