How do I populate a cell with the NT Logon username?

M

Mike

looling for a way, via a macro, to populate the cell with the users "NT
Logon" username
 
H

Harald Staff

Hi Mike

For Windows NT, 2000, XP this works:

Sub test()
Sheets(2).Range("H137").Value = Environ("username")
End Sub

HTH. Best wishes Harald
 
Top