ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I populate a cell with the NT Logon username? (https://www.excelbanter.com/excel-discussion-misc-queries/29073-how-do-i-populate-cell-nt-logon-username.html)

Mike

How do I populate a cell with the NT Logon username?
 
looling for a way, via a macro, to populate the cell with the users "NT
Logon" username

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

"Mike" skrev i melding
...
looling for a way, via a macro, to populate the cell with the users "NT
Logon" username





All times are GMT +1. The time now is 04:05 PM.

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