+ Reply to Thread
Results 1 to 2 of 2

Named Range Scope

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-18-2007
    Location
    Kiama, Australia
    MS-Off Ver
    365
    Posts
    119

    Question Named Range Scope

    Hi Folks,

    Hopefully this is a simple one.

    The following code defines the named range scope in the 'strWorksheet' Worksheet.
    How do I get it to define the named range scope in the Workbook?


    With Workbooks(strThisFileName).Worksheets(strWorksheet)
        ' Update the Named range "name_Automatic_Qualifier_Count" to include the range range BM5:rBottomRightCell.
        .Names.Add _
        Name:="name_Automatic_Qualifier_Count", _
        RefersToR1C1:=Range("BM5", Range("BM5", rBottomRightCell))
    End With

    Thanks,
    Craig

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Named Range Scope

    Hi Craig,
    Add the name to the Names collection of the workbook, not the one of the worksheet.
    With Workbooks(strThisFileName)
        ' Update the Named range "name_Automatic_Qualifier_Count" to include the range range BM5:rBottomRightCell.
        .Names.Add _
        Name:="name_Automatic_Qualifier_Count", _
        RefersToR1C1:=Range("BM5", Range("BM5", rBottomRightCell))
    End With
    Buran
    If you are pleased with a member's answer then use the Star icon to rate it.

+ 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