ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Function that returns worksheet name? (https://www.excelbanter.com/excel-worksheet-functions/125758-function-returns-worksheet-name.html)

[email protected]

Function that returns worksheet name?
 
Is there an Excel function that returns the name of the worksheet that
contains this formula?

I thought it might be part of cell("address"), which I could parse.
But that seems to be true only if the cell is in another worksheet.


JE McGimpsey

Function that returns worksheet name?
 
See

http://www.mcgimpsey.com/excel/formu..._function.html

In article .com,
wrote:

Is there an Excel function that returns the name of the worksheet that
contains this formula?

I thought it might be part of cell("address"), which I could parse.
But that seems to be true only if the cell is in another worksheet.


Gary''s Student

Function that returns worksheet name?
 
How about a single line UDF:

Function wsheetname()
wsheetname = Application.Caller.Parent.Name
End Function
--
Gary's Student


" wrote:

Is there an Excel function that returns the name of the worksheet that
contains this formula?

I thought it might be part of cell("address"), which I could parse.
But that seems to be true only if the cell is in another worksheet.



[email protected]

Function that returns worksheet name?
 
JE McGimpsey wrote:
See http://www.mcgimpsey.com/excel/formu..._function.html


Thanks! Funny, I was gonna try cell("filename"), but I let "logic" get
the better of me ("nah, filename has nothing to do with worksheet name,
which, after all, is just an object within the file"). I need to
remind myself to "throw caution to the wind" ;-).

That does require that I save the workbook first. But I can live with
that. Thanks again.


CLR

Function that returns worksheet name?
 

Sub sheetname()
Range("d1").Value = Application.ActiveSheet.Name
End Sub

Vaya con Dios,
Chuck, CABGx3




" wrote:

Is there an Excel function that returns the name of the worksheet that
contains this formula?

I thought it might be part of cell("address"), which I could parse.
But that seems to be true only if the cell is in another worksheet.




All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com