Reference in VBA to "Maximum change" Value ??

M

monir

Hello;

Following an iteration procedure (e.g.; using GoalSeek or Solver in a
standard macro), it makes sense to avoid equal or zero comparisons or to
introduce a new error tolerance.
For example, if the iteration result from the procedure is res1 within the
"Maximum change" value set at (tol1=) 1.E-6 (or whatever), and I need to
compare res1 with an analytical value val1 using the same tol1: (Excel 2003
SP3, Windows XP)

' tol1 = Maximum change value set under Options
IF abs( res1 - val1) > tol1 then
'.... do something
EndIF

How do I extract the value of (or make reference to) the "Maximum change"
value tol ??

Thank you kindly.
 
M

monir

Hi;

This works fine:

tol1 = Application.MaxChange
IF abs( res1 - val1) > tol1 Then
'.... do something
EndIF

It couldn't be simpler! Sorry, but I don't have a clue why it didn't work
earlier!

Regards.
 

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