Function UserNameWindows()

Darruk

New Member
Joined
Feb 10, 2010
Messages
1
Function UserNameWindows() As String
UserName = Environ("USERNAME")
End Function

I tried using the above function and it compiles properly but there is no output in the cell I apply the function to. I can see the function in the insert function field below the tool bars, but the cell is blank.

I am trying to fill the cell with the current logged in user's name.

Anyone have any suggestions?
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Hi and welcome to the board!!
You're close
Code:
Function UserNameWindows() As String
UserNameWindows = Environ("USERNAME")
End Function
I would, however, probably not use a UDF for this. What are you really trying to do?

lenze
 

Forum statistics

Threads
1,082,548
Messages
5,366,227
Members
400,880
Latest member
dwb

Some videos you may like

This Week's Hot Topics

Top