Numerical integration to a maximum value using VBA

  • Thread starter Thread starter John
  • Start date Start date
J

John

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
 
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
 
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
 
Back
Top