MIN/MAX question

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How do you write a min/max formula in VB?

Within a macro I'm trying to get the minimum of two
numbers. I tried the following and got an error:

END = MIN(BEGROW +10, MAXROW)

Where BEGROW and MAXROW are calclutaed within the macro.

thanks
 
Function MyMin(A, B)
if A < B then
MyMin = A
else
MyMin = B
End if
End Function


You can add error checking and so forth.
 

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

Back
Top