+ Reply to Thread
Results 1 to 2 of 2

Names Collection - Generating RefersToRange from RefersTo when RefersToRange not populated

  1. #1
    Registered User
    Join Date
    09-22-2018
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    4

    Names Collection - Generating RefersToRange from RefersTo when RefersToRange not populated

    I am working in the ThisWorkbook Names Collection in Excel VBA iterating through all the Names in a Workbook to compile a summary of all the various settings.

    The ThisWorkbook Name(rng_Name) RefersTo is always populated but ThisWorkBook Names(rng_Name) RefersToRange is not always populated dependent on what is actually referred to by the Name.

    I have found 3-D references and references to another Workbook typically appear to not have RefersToRange populated even though I would have thought they are simply ranges.

    I can build a Range (from RefersTo) by using text string manipulation to pull apart the RefersTo by searching for ! and : etc but there must be a more efficient means of doing this.

    I was initially thinking of using INDIRECT function or similar but that is not available in VBA.

    Can anyone make any suggestions about an efficient way of generating a Range (when one is not populated) from the RefersTo? I couldn’t find any prior threads covering this.

  2. #2
    Registered User
    Join Date
    09-22-2018
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    4

    Re: Names Collection - Generating RefersToRange from RefersTo when RefersToRange not popul

    Update
    It appears that Excel doesn't recognize the RefersTo string generated by 3-D References.
    Even when stripping out the = from the RefersTo string to generate a new str_1 and then when using Range(str_1) it will build a valid range for everything OTHER than 3D references.
    So I am stuck with having to use text string manipulation at the moment?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ActiveWorkbook.Names.Add - using Cell Value as an input to "RefersTo"
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2014, 11:52 AM
  2. ActiveWorkbook.Names.Add - using Cell Value as an input to "RefersTo"
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2014, 03:26 PM
  3. Trouble with the [worksheet].Names-collection!
    By uffe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2011, 06:09 AM
  4. When does Names.RefersToRange Property Fail?
    By asha3010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2010, 09:06 AM
  5. Memory leak in names collection?
    By Karri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2006, 11:45 AM
  6. [SOLVED] RefersToRange.Parent gives back an error(from book written by Bove
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2005, 10:05 PM
  7. [SOLVED] Help building string for Names.Add RefersTo, pls?
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-07-2005, 12:06 PM
  8. Define Names / RefersToRange
    By Andre Achtermeier in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2005, 12:06 PM

Tags for this Thread

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