Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet won't reference a named cell | Excel Worksheet Functions | |||
Worksheet Names is Defined by Cell value on Sheet 1 (named Summary | Excel Discussion (Misc queries) | |||
Can a sheet be named automatically based off the value of a cell? | Excel Worksheet Functions | |||
return cell from named sheet | Excel Discussion (Misc queries) | |||
referencing a sheet named in a cell then using data from that sheet | Excel Worksheet Functions |