Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Referering sheet name of a named cell

Hello,
I have a named cell "ADJ_COMMENTS" which is on an other sheet. How can I
know the name of the sheet that contains this cell ?

Dim myRange as Range
On error resume Next
Set myRange = ThisWorkbook.Names("ADJ_COMMENTS").RefersToRange 'is it
better to used Set myRange = Range("ADJ_COMMENTS") ?
If myRange Is Nothing Then
Else
myAdress = myRange.Address 'gives me $A$1 ok
mySheet = myRange. ??? .Application.Sheet.Name doesn't work.

Thank you.
--
Alex St-Pierre
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Referering sheet name of a named cell

Dim myRange As Range
On Error Resume Next
Set myRange = Range("ADJ_COMMENTS")
If Not myRange Is Nothing Then
myAdress = myRange.Address 'gives me $A$1 ok
mySheet = myRange.Parent.Name
End If


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Alex St-Pierre" wrote in message
...
Hello,
I have a named cell "ADJ_COMMENTS" which is on an other sheet. How can

I
know the name of the sheet that contains this cell ?

Dim myRange as Range
On error resume Next
Set myRange = ThisWorkbook.Names("ADJ_COMMENTS").RefersToRange 'is it
better to used Set myRange = Range("ADJ_COMMENTS") ?
If myRange Is Nothing Then
Else
myAdress = myRange.Address 'gives me $A$1 ok
mySheet = myRange. ??? .Application.Sheet.Name doesn't work.

Thank you.
--
Alex St-Pierre



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sheet won't reference a named cell Mike H Excel Worksheet Functions 2 September 9th 09 08:28 PM
Worksheet Names is Defined by Cell value on Sheet 1 (named Summary NeedToKnow Excel Discussion (Misc queries) 7 January 7th 09 07:44 PM
Can a sheet be named automatically based off the value of a cell? ktun Excel Worksheet Functions 1 May 16th 07 09:19 PM
return cell from named sheet AndrewB Excel Discussion (Misc queries) 1 April 18th 05 02:47 AM
referencing a sheet named in a cell then using data from that sheet gbeard Excel Worksheet Functions 4 April 15th 05 08:42 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"