Private Sub Workbook_Open()
Dim nLastUsedRowIndex As Integer
nLastUsedRowIndex = Application.WorksheetFunction.CountA(Worksheets("Access Time").Range("A:A")) + 1
Range("A" & nLastUsedRowIndex) = Now
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim nLastUsedRowIndex As Integer
nLastUsedRowIndex = Application.WorksheetFunction.CountA(Worksheets("Access Time").Range("B:B")) + 1
Range("B" & nLastUsedRowIndex) = Now
'Save the file and then exit the application
ActiveWorkbook.Save
Application.Quit
End Sub