Vicki Murphy
Vicki Murphy

Reputation: 1

Return User that makes a change

I have managed to get a VBA to return the date that a Row was last changed but I also want to be able to get the user that made that change.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 Then Exit Sub
Application.EnableEvents = False
 Cells(Target.Row, "N").Value = Date
Application.EnableEvents = True
End Sub

so this returns the Date as, 01/01/2020

I would like to have it also give who made the change, 01/01/2020, Jane Doe

Upvotes: 0

Views: 36

Answers (1)

braX
braX

Reputation: 11755

Where do you want to put the username? A different cell I assume?

Let's pretend you want to put it into the cell to the right of that one.

Cells(Target.Row, "O").Value = Environ$("UserName")

Upvotes: 1

Related Questions