ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   msg box (https://www.excelbanter.com/excel-worksheet-functions/66081-msg-box.html)

Mr. G.

msg box
 

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.



Bob Phillips

msg box
 
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)

"Mr. G." wrote in message
...

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.






All times are GMT +1. The time now is 05:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com