How to show current user name in a cell?

前端 未结 6 657
太阳男子
太阳男子 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条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 11:56

    if you don't want to create a UDF in VBA or you can't, this could be an alternative.

    =Cell("Filename",A1) this will give you the full file name, and from this you could get the user name with something like this:

    =Mid(A1,Find("\",A1,4)+1;Find("\";A1;Find("\";A1;4))-2)


    This Formula runs only from a workbook saved earlier.

    You must start from 4th position because of the first slash from the drive.

提交回复
热议问题