Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy name from active sheet to cell - using macro or function
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy name from active sheet to cell - using macro or function
Code you need is:
Cells(1, 1).Value = ActiveSheet.Name Assign the macro to a shortcut key, object or event (depending on your preference). "dymek" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro | Excel Discussion (Misc queries) | |||
Asked previously...can this not be done in excel | Excel Discussion (Misc queries) | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
need to Copy or Move to active cell from specified range | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions |