ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   "Last Modified by" (https://www.excelbanter.com/excel-worksheet-functions/184276-last-modified.html)

daltex

"Last Modified by"
 
Is there a way to insert a "Last Modified By" function in a worksheet? For
example, if a document is accessed by many users and you want to know who
modfied it last time and have their name automatically inserted say at the
bottom of the sheet with perhaps the NOW function. Thanks for any help.

Gaurav[_2_]

"Last Modified by"
 
try this code.

you will find the username in column Z

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("a1:iv65536")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, "Z").Value = Environ("username")
Application.EnableEvents = True
End Sub


"daltex" wrote in message
...
Is there a way to insert a "Last Modified By" function in a worksheet? For
example, if a document is accessed by many users and you want to know who
modfied it last time and have their name automatically inserted say at the
bottom of the sheet with perhaps the NOW function. Thanks for any help.




daltex

"Last Modified by"
 
Thank you. I need something simpler, though.

"Gaurav" wrote:

try this code.

you will find the username in column Z

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("a1:iv65536")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, "Z").Value = Environ("username")
Application.EnableEvents = True
End Sub


"daltex" wrote in message
...
Is there a way to insert a "Last Modified By" function in a worksheet? For
example, if a document is accessed by many users and you want to know who
modfied it last time and have their name automatically inserted say at the
bottom of the sheet with perhaps the NOW function. Thanks for any help.





Tom Hutchins

"Last Modified by"
 
Select Properties from the File menu and look on the Statistics tab.

Hope this helps,

Hutch

"daltex" wrote:

Thank you. I need something simpler, though.

"Gaurav" wrote:

try this code.

you will find the username in column Z

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("a1:iv65536")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, "Z").Value = Environ("username")
Application.EnableEvents = True
End Sub


"daltex" wrote in message
...
Is there a way to insert a "Last Modified By" function in a worksheet? For
example, if a document is accessed by many users and you want to know who
modfied it last time and have their name automatically inserted say at the
bottom of the sheet with perhaps the NOW function. Thanks for any help.






All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com