close

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 weekendquot;. If the user selects quot;Yesquot; a second box
requests the User provide additional information in a designated area of the
spreadsheet.

If Intersect(Target(1), Me.Range(quot;Y53:BN53quot;)) Is Nothing Then Exit Sub

If Target(1).Value gt; 125 And Target(1).Value lt; 250 Then
If MsgBox(quot;Was vehicle held over the weekend?quot;, _
vbYesNo) = vbYes Then
MsgBox quot;Please give reason with approving Manager's namequot;
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
Range(quot;Y317quot;).Select
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
ActiveCell.FormulaR1C1 = quot;Xquot;
Range(quot;Y53quot;).Activate
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)

End If
End If
If Intersect(Target(1), Me.Range(quot;Y53:BN53quot;)) Is Nothing Then Exit Sub
If Target(1).Value gt;= 250 Then
If MsgBox(quot;Was vehicle held over the weekend?quot;, _
vbYesNo) = vbYes Then
MsgBox quot;Please give reason with approving Manager's namequot;
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
Range(quot;Y317quot;).Select
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
ActiveCell.FormulaR1C1 = quot;Xquot;
Range(quot;Y53quot;).Activate
Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
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.
Put it within a loop

Do
ans = MsgBox (quot;Please give reason with approving Manager's namequot;)
if ans = quot;quot; Then MsgBox quot;I need an answerquot;
Loop until ans lt;gt; quot;quot;

ans will then hold that respnse--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Mr. G.quot; gt; wrote in message
news
gt;
gt; I've created an expense report that displays a yes/no message box when the
gt; User reports auto rental expenses. The first msg box inquires if they
held
gt; the rental over the weekendquot;. If the user selects quot;Yesquot; a second box
gt; requests the User provide additional information in a designated area of
the
gt; spreadsheet.
gt;
gt; If Intersect(Target(1), Me.Range(quot;Y53:BN53quot;)) Is Nothing Then Exit Sub
gt;
gt; If Target(1).Value gt; 125 And Target(1).Value lt; 250 Then
gt; If MsgBox(quot;Was vehicle held over the weekend?quot;, _
gt; vbYesNo) = vbYes Then
gt; MsgBox quot;Please give reason with approving Manager's namequot;
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt; Range(quot;Y317quot;).Select
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt; ActiveCell.FormulaR1C1 = quot;Xquot;
gt; Range(quot;Y53quot;).Activate
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt;
gt; End If
gt; End If
gt; If Intersect(Target(1), Me.Range(quot;Y53:BN53quot;)) Is Nothing Then Exit
Sub
gt; If Target(1).Value gt;= 250 Then
gt; If MsgBox(quot;Was vehicle held over the weekend?quot;, _
gt; vbYesNo) = vbYes Then
gt; MsgBox quot;Please give reason with approving Manager's namequot;
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt; Range(quot;Y317quot;).Select
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt; ActiveCell.FormulaR1C1 = quot;Xquot;
gt; Range(quot;Y53quot;).Activate
gt; Sheets(quot;EXP RPTquot;).Unprotect (quot;lindAPquot;)
gt; End If
gt; End If
gt; End Sub
gt;
gt; Unfortunately, many of my users often don't comply thus forcing me to
spend
gt; extra time following-up. Is it possible to customize the second box so
that
gt; it requires the User to input the necessary information (possibly in
another
gt; pop-up box) before they can move on? Moreover, can their information be
gt; automatically copied to area that was originally intended for their
gt; explanation.
gt;
gt;
arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()