Forum Discussion

Rolf_Heller's avatar
Rolf_Heller
Copper Contributor
Aug 28, 2024

Is there a „=Sheetname(1)“ in Excel for direct input into a cell (no macro or VBA)

I am looking for an Excel-function „sheetname(1)“ with name of the first sheet presented in the workspace for the construction of references. Does this function exist in Excel 365 for direct input without macro or VBA?

Rolf Heller

    • Rolf_Heller's avatar
      Rolf_Heller
      Copper Contributor

      It‘s a pity. The info is definitively in Excel, but not available directly. And such a function is not that complex to produce by Microsoft. Perhaps I am the only boy longing for such a function.

      • mathetes's avatar
        mathetes
        Silver Contributor

        Rolf_Heller wrote:

        I am looking for an Excel-function „sheetname(1)“ with name of the first sheet presented in the workspace for the construction of references. Does this function exist in Excel 365 for direct input without macro or VBA?

         

        HansVogelaar replied

        Unfortunately not - this requires either a custom VBA function or a defined name using an Excel 4.0 Macro function.

         

        To which I'm going to add a third way: I created a LAMBDA function (that is, I named a function of my own called "Retrieve") which calls on a LET function that will take as input a reference to a cell that contains a sheet name (the sheet name occasionally consists of two references, cl and CM; sometimes CM is blank). Taken all together, =Retrieve creates a reference to a sheet and a cell in that sheet and assembles all of that into an INDIRECT function. Here's what it looks like:

         

        =LAMBDA(cl,CM,rw,LET(tab,cl&IF(CM="","","_"&CM)&"!"&rw,INDIRECT(tab)))

         

Resources