UserName Property

Microsoft Excel Visual Basic

Returns or sets the name of the current user. Read/write String.

Example

This example displays the name of the current user.

MsgBox "Current user is " & Application.UserName