Newbie: msgbox + excel

  • Thread starter Thread starter crmber
  • Start date Start date
C

crmber

Hi all;

I'm writing a code for a macro in ms excel 2000 and I'm having some
troubles with MsgBox. Here is an example of the code:

Public Function RCL(PLI As Single, RMA As Single)

If RMA > 49 And RMA < 71 Then
RCL = 0.91568 * (1 - Exp(-Exp(-1.8956) * (PLI - 1)))

Else
YesNo = MsgBox("RMA out of range!", vbYesNo)
Select Case YesNo
Case vbYes
RCL = 0.75624 * (1 - Exp(-Exp(-1.070025) * (PLI - 1)))
End

Case vbNo
MsgBox "Error"
End

End Select
End If
End Function

.............
After pressing YES/NO I want to MsgBox doesn't show up more than one
time. In the current situation, when I enter a value out of range, the
message appear several times and I have to press OK until I get some
result


Any hint

Thanks
 
Hi all;

I'm writing a code for a macro in ms excel 2000

In that case, please scroll down the list of newsgroups to an
appropriate microsoft.public.excel newsgroup. This newsgroup is for a
different program, the database software Microsoft Access.

John W. Vinson[MVP]
 

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