Capture user name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have this statement in macro that insert the date in a cell anytime
someone makes a change within a given row:

If Intersect(Target, Columns("G:R")) Is Nothing Then
Exit Sub
End If
n = Target.Row
Cells(n, "U").Value = Format(Now, "mm-dd-yyyy")
End Sub

I'd also like it to capture the username and input it in the same cell --
what do I need to do add to this statement to make that happen? Thanks.
 
try this line

Cells(n, "U").Value = Environ("Usernme") & " " & Format(Now, "mm-dd-yyyy")
 
sorry had a misspelling

Cells(n, "U").Value = Environ("Username") & " " & Format(Now, "mm-dd-yyyy")
 

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