Thursday, 15 August 2013

excel vba - VBA MsgBox keeps coming back -


I'm new to VBA I'm having a problem with a message box and I can not seem to find the answer . So the explanation hears if the value of a particular cell is & lt; 0 then the user is trying to issue a payment on the maximum amount acceptable (which should be on a very rare occasion). I have created a pop up to ask yes / no to continue with the payment, if they do not press anything then it cancels the final entry and they can re-enter the payment.

But if they click Yes the pop-up gets out, which I want, but it keeps popping up at any time while trying on a spreadsheet and doing anything because the value Continued & lt; 0

  Personal sub worksheet (sub target in the form of range) if category ("C39") & lt; 0 If the MSBbox ("total cash flow / payment can not exceed the maximum contract amount" and VBCRF and "Do you want to continue?", VbYesNo + vbCritical, "WARNING") = vbNo then application Code code   

There are several ways to work according to this code, but on behalf of the business, my suggestion That's when they choose yes that you capture your selection and make this comment for their own record.

This will also allow you to use that last selection in your top level if the statement is set, for example, if you have set the range ("40") for "acceptable" when yes selected If so, you could say that

  is the range ("C39") & lt; 0 more range ("C40") & lt; & Gt; "Acceptable" then if the MSBbox ("total cash flow / payment can not exceed the maximum contract amount" & amp; vbCrLf & quot; do you want to continue? ', VbYesNo + vbCritical, "WARNING" ) = VbNo Then Application.Undo Else Range "C40"). Value = "acceptable" end if end if  

No comments:

Post a Comment