PDA

View Full Version : [SOLVED:] Last User Save



psctornado
01-30-2017, 07:18 AM
Hi All,

I've been working on a workbook where multiple users will be using it, and I was looking to see if there is a vba formula out there where I can track the last username. I've tried using the builtinproperties feature, but that gives me the last author, which in our system is different than the last user.

Ideally, I'd like the username to end up in a specific cell, say A2 or something like that.

Any help would be greatly appreciated :)

jonh
01-30-2017, 08:39 AM
What do you mean by user? For new information to be stored in the file you need to save it.


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
sheets("sheet1").Range("a2") = Environ("username")
End Sub



Or turn 'track changes' on.


If you also want to log users who only read the file, you'll need to store the data externally.

psctornado
01-30-2017, 09:03 AM
Thanks Jonh. My issue is that I didn't have it in the 'BeforeSave' area. Thanks for the reply!