Thread: date/time stamp
View Single Post
  #8   Report Post  
DKY
 
Posts: n/a
Default


Okay, so here's my code then (that I stole from this site and revised to
fit my needs).


Code:
--------------------
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(.Cells, Me.Range("E:E")) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 2)
.Value = Now
.NumberFormat = "mmm dd yyyy hh:mm:ss AM/PM"
End With
End If
End With
ws_exit:
Application.EnableEvents = True
End Sub
--------------------


How would I go about adding the windows log-on username to this? I
found this

http://blogs.officezealot.com/charle...2/10/3574.aspx

Which says you can use this


Code:
--------------------
Function UserNameWindows() As String
UserName = Environ("USERNAME")
End Function
--------------------


But where do I put the function in the code and how do I call it to
use?


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=380369