ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell to equal a worksheet's name (https://www.excelbanter.com/excel-discussion-misc-queries/30148-cell-equal-worksheets-name.html)

David P.

Cell to equal a worksheet's name
 
Is there a way for a cell to equal the worksheet's name?
--
David P.

Paul B

David, try this, the file must have been saved for this to work

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"David P." wrote in message
...
Is there a way for a cell to equal the worksheet's name?
--
David P.




David P.

Thank you Paul. Because I am a novice when it comes to code and where code
goes (other than where macros are stored by default) can you clarify what
your suggestion means...couple of questions:

1) Where does the code go that you suggested?

2) Would the code you suggested be a macro? that formats the value of the
specified cell to "equal the active worksheet's name"?

3)If my cell is A1 for example, which of the following parts of your
suggestion do I change:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

4) If it is a macro would the final format look like this (with the
neccesary changes made to your example)?:

Sub macroname()
'
' macroname Macro
' Macro recorded 6/10/2005 by BLINDS ETC
'

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

5) Can you suggest a recource for me that might be titled "Visual Basic Code
for Dummies":) ? Thanks again.

--
David P.


"Paul B" wrote:

David, try this, the file must have been saved for this to work

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"David P." wrote in message
...
Is there a way for a cell to equal the worksheet's name?
--
David P.





Dave Peterson

This formula goes into any cell that you want--it's a regular worksheet formula.

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

But the workbook does have to be saved at least once for this to work.

Debra Dalgleish has a list of books at her site:
http://www.contextures.com/xlbooks.html

John Walkenbach's is a nice one to start with. I think that John Green (and
others) is nice, too (for a second book??). See if you can find them in your
local bookstore and you can choose what one you like best.


David P. wrote:

Thank you Paul. Because I am a novice when it comes to code and where code
goes (other than where macros are stored by default) can you clarify what
your suggestion means...couple of questions:

1) Where does the code go that you suggested?

2) Would the code you suggested be a macro? that formats the value of the
specified cell to "equal the active worksheet's name"?

3)If my cell is A1 for example, which of the following parts of your
suggestion do I change:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

4) If it is a macro would the final format look like this (with the
neccesary changes made to your example)?:

Sub macroname()
'
' macroname Macro
' Macro recorded 6/10/2005 by BLINDS ETC
'

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

5) Can you suggest a recource for me that might be titled "Visual Basic Code
for Dummies":) ? Thanks again.

--
David P.

"Paul B" wrote:

David, try this, the file must have been saved for this to work

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"David P." wrote in message
...
Is there a way for a cell to equal the worksheet's name?
--
David P.





--

Dave Peterson


All times are GMT +1. The time now is 09:38 AM.

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