ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numerical integration to a maximum value using VBA (https://www.excelbanter.com/excel-programming/366152-numerical-integration-maximum-value-using-vba.html)

John[_121_]

Numerical integration to a maximum value using VBA
 
Hi folks! I'm new here, so be gentle with me!

I have a plain old spreadsheet that I manually manipulate to numerically
integrate a function until it reaches a maximum value. I am trying to add
some VBA automation to it to speed things up and increase accuracy. One
thing I would like it to do is automatically halt the iterating as soon as
the function is summed to it's maximum value. Can someone offer some advice
on how to do that? Thanks!

--
John - ThunderSnake #59
'69 Mach 1 w/ 390 4V
Wide Ratio Toploader
3.50 Traction-Lok
Acapulco Blue




[email protected]

Numerical integration to a maximum value using VBA
 
Hi John,

You can tell the VBA debugger to stop when a variable will be given a
certain value.

You can estimate this value and enter it or you can store its old value
(of previous iteration), subtract this from the newer one and stop the
program if the difference becomes < zero (if your iteration is
monotonously increasing).

HTH,
Bernd


John[_121_]

Numerical integration to a maximum value using VBA
 
Bernd,

It helped a lot. I used the Do While Loop and stopped it as soon as it
started decreasing! Thanks!

--
John - ThunderSnake #59
'69 Mach 1 w/ 390 4V
Wide Ratio Toploader
3.50 Traction-Lok
Acapulco Blue

wrote in message
ps.com...
Hi John,

You can tell the VBA debugger to stop when a variable will be given a
certain value.

You can estimate this value and enter it or you can store its old value
(of previous iteration), subtract this from the newer one and stop the
program if the difference becomes < zero (if your iteration is
monotonously increasing).

HTH,
Bernd





All times are GMT +1. The time now is 04:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com