ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   create function (https://www.excelbanter.com/excel-worksheet-functions/8302-create-function.html)

Luc M

create function
 
hi,
i've created a custom function that returns the name of the tab in which the
cell is :

ThisWorksheetName = ThisWorkbook.ActiveSheet.Name

but this is not correct because of the 'ActiveSheet' property. My function
returns the name of the active sheet but not the name of the sheet containing
my formula...

does anyone have any suggestion ?
thanks

Norman Jones

Hi Luc,

Try:

ThisWorksheetName = Application.Caller.Parent.Name


---
Regards,
Norman



"Luc M" wrote in message
...
hi,
i've created a custom function that returns the name of the tab in which
the
cell is :

ThisWorksheetName = ThisWorkbook.ActiveSheet.Name

but this is not correct because of the 'ActiveSheet' property. My function
returns the name of the active sheet but not the name of the sheet
containing
my formula...

does anyone have any suggestion ?
thanks




Frank Kabel

Hi
for a non VBA solution see:
http://www.xldynamic.com/source/xld.xlFAQ0002.html



--
Regards
Frank Kabel
Frankfurt, Germany

Luc M wrote:
hi,
i've created a custom function that returns the name of the tab in
which the cell is :

ThisWorksheetName = ThisWorkbook.ActiveSheet.Name

but this is not correct because of the 'ActiveSheet' property. My
function returns the name of the active sheet but not the name of the
sheet containing my formula...

does anyone have any suggestion ?
thanks





All times are GMT +1. The time now is 04:01 PM.

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