ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   return sheet name (https://www.excelbanter.com/excel-programming/373199-return-sheet-name.html)

robin

return sheet name
 
How can I open a file with multiple sheets and have a formula or code return
the names of the sheets so i can perform calculations on varying sheets with
out manually having to input them into my formulas.

Example: i open a file created by anouther user that has 7 or 8 sheets with
different names depending on the data in the sheets. I want to be able for my
formulas to adjust to those names with having to input them in manually.

Carim

return sheet name
 
Hi Robin,

Following formula does the job ...

=MID(CELL("filename",A1), FIND("]", CELL("filename",A1))+ 1, 255)

HTH
Cheers
Carim


Stopher

return sheet name
 

Robin wrote:
How can I open a file with multiple sheets and have a formula or code return
the names of the sheets so i can perform calculations on varying sheets with
out manually having to input them into my formulas.

Example: i open a file created by anouther user that has 7 or 8 sheets with
different names depending on the data in the sheets. I want to be able for my
formulas to adjust to those names with having to input them in manually.


My guess is that the sheets you are doing the calcs on have standard
names, and that this is true for each file.

If that is true then you could create a macro that uses the standard
names of the sheets, regardless of the worksheet name. Or to make it
more transportable you could create an Add-In with functions that
reference specific sheets in any workbook.

So

Function ABC()
ABC = [Insert Macro or formula here]
End function

And then any sheet you type =ABC it will do the calc.

This is a very simple no specific example, and also assumes that your
files are in an exact format, or you will have to start introducing
named ranges and calling them in your formula as well.



All times are GMT +1. The time now is 01:28 AM.

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