+ Reply to Thread
Results 1 to 5 of 5

Extract the defined name from a cell

  1. #1
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Question Extract the defined name from a cell

    So on my Excel spreadsheet I can select cell B2 of Sheet1 and using the name box give that cell a name such as "Important_Cell".

    I know using VBA I can access the cell using the name, such as:
    Please Login or Register  to view this content.
    But can I get that name FROM the cell?

    I have tried the following:
    Please Login or Register  to view this content.
    But all that gave me in name_string was:

    "='Sheet1'!$B$1"

    Is there anyway to extract the actual defined name?

    Thanks
    Last edited by Phil_V; 06-10-2009 at 09:11 AM.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Extract the defined name from a cell

    Close:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Extract the defined name from a cell

    That works great, but I don't understand why

    Can you explain why you need to double the .Name ?

    Thanks

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Extract the defined name from a cell

    The initial .Name returns the Name object, and because you didn't specify what property you wanted, you get its default Value property. You actually wanted the name of the Name object!

  5. #5
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Extract the defined name from a cell

    Aha I see, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1