Re: What is default property of name object
- From: "Peter T" <peter_t@discussions>
- Date: Wed, 27 Jun 2007 18:00:31 +0100
Hi again,
I see what you mean but it's not really an inconsistency
say you did -
Set rng = [a1]
then
v = rng
v returns the default property of the range which is its value, not the cell
reference or its name if it has one.
If you are trying to return your range's name then you need to return the
Name property of the Name object.
As before -
On error resume next ' in case the range doesn't have a Name
s = ""
s = Range("A1:a3").Name.Name
similarly
set nm = activeworkbook.names("test")
s = nm.Name ' 'test
Regards,
Peter T
"clara" <clara@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE0AA8B9-27C0-424D-A77C-7FFF762C5145@xxxxxxxxxxxxxxxx
Hi Peter,a
Thank you very mcuh!
What I really mean is that there is an inconsistency here since we use
Range("A1:a3").Name = "data"( Set method) to assign a name, we can not
retrieve(Get) by referring to Range("A1:a3").Name
Clara
--
thank you so much for your help
"Peter T" wrote:
Hi Clara,
The default property of a Name is RefersTo, hence if the name refers to
range returning the default property will return its address
Maybe you want this -
On error resume next
s = ""
s = Range("A1:a3").Name.Name
on error goto 0
If len(s) then
msgbox s & vbcr & Range("A1:a3").Name
else
msgbox "the range is not defined"
End if
Regards,
Peter T
"clara" <clara@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68DAC615-D4AF-4FEB-8CEF-AEA4D0287F91@xxxxxxxxxxxxxxxx
Hi all,
I can use
Range("A1:a3").Name = "data"
to define a name object.
but Range("A1:a3").Name will display the address of the name object
Could you explain why?
Clara
--
thank you so much for your help
.
- Follow-Ups:
- Re: What is default property of name object
- From: NickHK
- Re: What is default property of name object
- References:
- Re: What is default property of name object
- From: Peter T
- Re: What is default property of name object
- From: clara
- Re: What is default property of name object
- Prev by Date: Re: How to obtain cell address of a succesful VLookup?
- Next by Date: Re: Find string in Data
- Previous by thread: Re: What is default property of name object
- Next by thread: Re: What is default property of name object
- Index(es):
Relevant Pages
|
Loading