View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default copy name from active sheet to cell - using macro or function

=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1) )-FIND("]",CELL("filename",A1)))

OR:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,LEN(CELL("filename",A 1))-FIND("]",CELL("filename",A1)))
OR:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,99)
OR:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
NOTE: The above 3 formulas do not work if the sheet name is the same
as the file name
without the .xls. IOW, if the sheet name is Able and the file name is
Able.xls, it won't work.
HTH Otto

"dymek" wrote in message
...
Hello,

I'm newbie I'm looking for function or macro which can give copy name of
worksheet to cell in eg. A1.

Is it possible?

Of course function is the best option.

Thanks in advance.

Rgs,
dymek