msg box

M

Mr. G.

I've created an expense report that displays a yes/no message box when the
User reports auto rental expenses. The first msg box inquires if they held
the rental over the weekend". If the user selects "Yes" a second box
requests the User provide additional information in a designated area of the
spreadsheet.

If Intersect(Target(1), Me.Range("Y53:BN53")) Is Nothing Then Exit Sub

If Target(1).Value > 125 And Target(1).Value < 250 Then
If MsgBox("Was vehicle held over the weekend?", _
vbYesNo) = vbYes Then
MsgBox "Please give reason with approving Manager's name"
Sheets("EXP RPT").Unprotect ("lindAP")
Range("Y317").Select
Sheets("EXP RPT").Unprotect ("lindAP")
ActiveCell.FormulaR1C1 = "X"
Range("Y53").Activate
Sheets("EXP RPT").Unprotect ("lindAP")

End If
End If
If Intersect(Target(1), Me.Range("Y53:BN53")) Is Nothing Then Exit Sub
If Target(1).Value >= 250 Then
If MsgBox("Was vehicle held over the weekend?", _
vbYesNo) = vbYes Then
MsgBox "Please give reason with approving Manager's name"
Sheets("EXP RPT").Unprotect ("lindAP")
Range("Y317").Select
Sheets("EXP RPT").Unprotect ("lindAP")
ActiveCell.FormulaR1C1 = "X"
Range("Y53").Activate
Sheets("EXP RPT").Unprotect ("lindAP")
End If
End If
End Sub

Unfortunately, many of my users often don't comply thus forcing me to spend
extra time following-up. Is it possible to customize the second box so that
it requires the User to input the necessary information (possibly in another
pop-up box) before they can move on? Moreover, can their information be
automatically copied to area that was originally intended for their
explanation.
 
B

Bob Phillips

Put it within a loop

Do
ans = MsgBox ("Please give reason with approving Manager's name")
if ans = "" Then MsgBox "I need an answer"
Loop until ans <> ""

ans will then hold that respnse


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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