Hi all,
Is there any way to get the name of a worksheet by CodeName or any parameter?
So, something like quot;=GetWorksheetName(quot;Sheet1quot;)quot; gives me quot;My Sheetquot;.
Thank you.
---
Tetsuya Oguma, Singpaore
Answering your subject line more than the body
=MID(CELL(quot;filenamequot;,A1),FIND(quot;]quot;,CELL(quot;filenamequot;,A1)) 1,32)
will return the sheet name of the sheet that holds the formula as long as
the workbook is saved first
--
Regards,
Peo Sjoblom
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email address)
Portland, Oregon
quot;Tetsuya Ogumaquot; gt; wrote in message
...
gt; Hi all,
gt;
gt; Is there any way to get the name of a worksheet by CodeName or any
gt; parameter?
gt;
gt; So, something like quot;=GetWorksheetName(quot;Sheet1quot;)quot; gives me quot;My Sheetquot;.
gt;
gt; Thank you.
gt; ---
gt; Tetsuya Oguma, Singpaore
support.microsoft.com/?kbid=213475
here's the microsoft.com for UDF to put sheet name in a cell;
as well as some other codes that have been in the forumlist sheet macro
here is a great code from two greats!
insert this code in a module and assign a button to it, even create a
button in the toolbars.
When you click on the button a list of your sheets will pop up, you can
even click on one of the sheets in the list and you will go there.Sub SheetList_CP()
'Chip Pearson, 2002-10-29, misc., #ByZYZ3fCHA.1308@tkmsftngp11
'Dave Peterson, same date/thread, 3DBF0BA8.4DAE9DA0@msn.com
On Error Resume Next
Application.CommandBars(quot;Workbook Tabsquot;).Controls(quot;More
Sheets...quot;).Execute
If Err.Number gt; 0 Then
Err.Clear
Application.CommandBars(quot;Workbook Tabsquot;).ShowPopup
End If
On Error GoTo 0
End Sub
for more on sheets check out this site
www.mvps.org/dmcritchie/excel/sheets.htm
Here's another code you might like, insert it in your worksheet module
Whatever the value you have in Cell A1, will be your sheet name, just
interesting!Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count gt; 1 Then Exit Sub
If Target.Address = quot;$A$1quot; Then
If Target.Value lt;gt; quot;quot; Then
Me.Name = Target.Value
End If
End If
End Sub
Edit/Delete Message--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=520904
- Aug 28 Tue 2007 20:39
Get a Worksheet name through a function
close
全站熱搜
留言列表
發表留言