Hello All,
I am trying to ask to the user to check if they logged out when they close the workbook but my code is not working...
Here it is:
Any Ideas??
Thanks
I am trying to ask to the user to check if they logged out when they close the workbook but my code is not working...
Here it is:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("OD&D Log-in").Select
If Range("H5") = "reconcile" Then
a = MsgBox("Do you want to Log-Out?", _
vbYesNo)
If a = vbNo Then Cancel = True
If a = vbYes Then
Sheets("OD&D Log-in").Select
Else
Workbooks("Daily OSD Log (ver5).xls").Close SaveChanges = True
End Sub
Any Ideas??
Thanks
Last edited by a moderator: