Forum Discussion

Ashley315's avatar
Ashley315
Copper Contributor
Mar 13, 2024
Solved

Populate Username without VBA?

Is there a way to populate the Excel user's name in a cell w/o using VBA?

 

Trying an IF functio nthat would populate username if data is entered in a corresponding cell. However, I cannot use C:\Users because this is a shared workbook. Trying to avoid VBA due to security/automation challenges. Can I somehow pull the username from the Excel account info and populate using a formula?

 

Current formula: =IF(C2<>"",IF(E2="", LET(fullpath,INFO("DIRECTORY"),path,SUBSTITUTE(fullpath,"C:\Users\",""),LEFT(path,FIND("\",path)-1)),E2),"")

5 Replies

    • Ashley315's avatar
      Ashley315
      Copper Contributor

      SergeiBaklan Thanks for confirming. Is there a way I can access the Excel Username and not the username from the file path? 

      • m_tarler's avatar
        m_tarler
        Bronze Contributor

        are scripts allowed? they won't autorun or accessable using a function but can run on a button press and can get you the username that is logged in to excel.

        Besides, won't that formula keep changing the "username" based on the folder it is in.  So even if you could do a trick to get the user name based on the user directory, as soon as someone else opens it the formula would update to that new persons name.  For a 1-time write option you really need either a macro or script or you can use power automate if you put it in sharepoint

Resources