Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    NJ, USA
    Posts
    239
    Thanks
    2
    Thanked 1 Time in 1 Post

    Global ranges (VBA) (XL 2003)

    Have never quite figured out how to reference global range names in VBA. For local (worksheet-level) names, something like
    Workbooks("MyBook").Worksheets("MySheet").Range("m yName").Value will always work. You'd think that for global ranges, you'd specify
    Workbooks("MyBook").Range("myName").Value However, that only seems to work sometimes - presumably depending on what's active when the code is running.
    Before now I've used the RefersToRange property, but what is the preferred method of obtaining the value in a workbook-level name?
    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Global ranges (VBA) (XL 2003)

    Try Workbooks("MyBook").Names("myName").RefersToRange etc.

Posting Permissions

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