• Named Ranges in Excel

    Author
    Topic
    #1767484

    Does anybody know how to:
    1. Change what cells a range name refers to?
    2. Examine what cells a range name refers to?
    3. Loop through all range names?

    Alternatively, is it possible to access named ranges of one workbook from a worksheet in another workbook?

    Viewing 0 reply threads
    Author
    Replies
    • #1775122

      Well, it just so happens I can answer some of your question, as I’m doing a project on this very thing right now.
      1. Change what cells a range name refers to?
      try:
      ActiveWorkbook.Names.Add Name:=”test”, RefersToR1C1:=”=Sheet1!R6C4:R14C5″
      where test refers to the existing range name. You can use alphanumeric row/column referencing.

      2. Examine what cells a range name refers to?
      By this I assume you mean, navigate to the range itself?
      Try:
      Application.Goto Reference:=”test”

      3. Loop through all range names?
      I’d be fascinated to hear a suggestion on that one myself.

      Cheers
      Catharine

      • #1775127

        In answer to questions 2 & 3:

        Dim xlnname As Excel.Name
        For Each xlnname In Excel.Names
        Debug.Print xlnname.Name; ” “; xlnname.RefersTo
        Next

        • #1775129

          Cool!

          • #1775130

            Yeah, it took a little bit of digging to find that when I needed it. I found it eventually by recording the action of creating a named range.

            BTW, your pic would be improved by setting a transparent background. You can do that through many of the paint programs like PaintShop Pro.

            • #1775131

              And here I’ve been spending an unreasonable amount of time trying to get a groovy signature like you!

            • #1775231

              Thanks to both of you.

    Viewing 0 reply threads
    Reply To: Named Ranges in Excel

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: