+ Reply to Thread
Results 1 to 3 of 3

Scope NamedRange to Multiple WorkSheets

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Scope NamedRange to Multiple WorkSheets

    Is there a way with VBA that you can scope the same NamedRange to multiple worksheets? I would like to set the Named Range "WPStatus" to cell B3 on every worksheet in my workbook.

    I know I do this individually by naming and then scoping the specific worksheet. But can be done with VBA? I have about 50 sheets I would like to scope this to.

    Then after I have them all scoped, I can then actually move/drag that cell to the correct place on the worksheet and reference the namedrange on each sheet as needed. The will all not reside in cell B3 when its all complete.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Scope NamedRange to Multiple WorkSheets

    Try
    Name: NamedRange
    RefersTo: =!$B$3

    Then the formula =NamedRange will return the value from B3 of the sheet on which the formula resides.

    However, dragging the cell will not change the reference to NamedRange. And NamedRange will refer to the same cell address on every sheet. NamedRange is a workbook scoped name.

    If you want a VBA routine to set a worksheet scoped name for each sheet you could use.

    Please Login or Register  to view this content.
    When the cell is cut/paste, these (sheet scoped) names will adjust.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Scope NamedRange to Multiple WorkSheets

    Quote Originally Posted by mikerickson View Post
    Try
    Name: NamedRange
    RefersTo: =!$B$3

    Then the formula =NamedRange will return the value from B3 of the sheet on which the formula resides.

    However, dragging the cell will not change the reference to NamedRange. And NamedRange will refer to the same cell address on every sheet. NamedRange is a workbook scoped name.

    If you want a VBA routine to set a worksheet scoped name for each sheet you could use.

    Please Login or Register  to view this content.
    When the cell is cut/paste, these (sheet scoped) names will adjust.
    Thanks, I found what I think is also another simple way to do it like this too

    Please Login or Register  to view this content.

+ 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. [SOLVED] Combine Minimum of NamedRange with Offset
    By coreytroy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 10:32 PM
  2. Read Comments on NamedRange
    By viz.p in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2010, 09:33 AM
  3. Worksheets("NamedRange").ShowAllData Runtime error in 2007 but not 03
    By TKshelton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2010, 12:12 PM
  4. [SOLVED] Unhide sheet based on NamedRange?
    By Michael Beckinsale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2006, 10:15 AM
  5. NamedRange in Tools for Office 2003?
    By Lars Schouw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2005, 02:05 AM

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