How to show current user name in a cell?

前端 未结 6 735
太阳男子
太阳男子 2021-02-02 11:26

In most of the online resource I can find usually show me how to retrieve this information in VBA. Is there any direct way to get this information in a cell?

For example

6条回答
  •  萌比男神i
    2021-02-02 12:06

    This displays the name of the current user:

    Function Username() As String
        Username = Application.Username
    End Function
    

    The property Application.Username holds the name entered with the installation of MS Office.

    Enter this formula in a cell:

    =Username()
    

提交回复
热议问题