The code below checks out something for me once the user decides to close the
program. It gives a pop up box if appropriate.
Here is my code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Daily Log of Students Seen").Range("C40").Value <
Worksheets("Daily Log of Students Seen").Range("W40").Value Then
Msg = "You have forgot to appropriately record your time!"
Ans = MsgBox(Msg, vbOKOnly + vbExclamation, "Please add your time in
or time out")
End If
End Sub
I want to add an If Then statement that if they select
VB OK then the
program won't close. How do I prevent the program from closing?
--
Thanks
Shawn