ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Function that gives Windows current user name? (https://www.excelbanter.com/excel-worksheet-functions/7622-function-gives-windows-current-user-name.html)

Petu

Function that gives Windows current user name?
 
I need to know current Windows user name and update it to Excel sheet by
function?

Harald Staff

Hi

This needs a little VBA. In Win NT / Win 2000 / Win XP it's simply

Function CurrentUser() As String
CurrentUser = Environ("username")
End Function

Win 9x requires some windows programming. Post back if that's needed.

HTH. Best wishes Harald

"Petu" skrev i melding
...
I need to know current Windows user name and update it to Excel sheet by
function?




Frank Kabel

Hi
in VBA use:
msgbox environ("username")


"Petu" wrote:

I need to know current Windows user name and update it to Excel sheet by
function?



All times are GMT +1. The time now is 04:08 AM.

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