how can i know the last user who open the workbook

  • Thread starter Thread starter Sebation.G
  • Start date Start date
S

Sebation.G

Hi,cas i share my wrokbook with a group , i want wirte a macro code to know
the last user &time who open the workbook ?

any help will be appreciated
 
Put:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set r = Sheets("Sheet1").Range("Z100")
r.Value = Environ("UserName")
r.Offset(0, 1).Value = Now
End Sub


in the ThisWorkbook code area. The previous user's name and date/time will
be recorded in Z100 and Z101.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top