Hello, I have a workbook that requires users to login. The user information is stored on a sheet named "Login". The sheet contains lists. One list shows user names and passwords, another records the date and time that users login and another list (field) shows the current user. When the user logs out the current user field is set to blank (" "). I want this field to default to " " if the user fails to logout.
The field in question is on sheet "Login" and at P8.
I used this code to clear the field before close but it doesn't work. However the same line of code on the workbook_open works fine. Does anyone know why this is? Not that it should matter but the logic in my brain says that the logout should occur on close and not on open.
This does not work
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("Login").Cells(8, 16) = " "
End Sub
This works
Private Sub Workbook_Open()
Worksheets("Login").Cells(8, 16) = " "
End Sub
Bookmarks