+ Reply to Thread
Results 1 to 3 of 3

Creating a relative named range that can be used across more than one worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Excel 2003, 2010
    Posts
    14

    Creating a relative named range that can be used across more than one worksheet

    Hi there,

    I am using named ranges to determine conditions for formatting in Excel 2007. In this example the named ranged would resolve to 1 or 0:

    Fail=(Dashboard!G6<Dashboard!$E6)*(Dashboard!$R6="H")+(Dashboard!G6>Dashboard!$E6)*(Dashboard!$R6="L")

    I would like to be able to reuse this across multiple sheets, i.e. enter the formula like this in the Name Manager:

    Fail=(G6<$E6)*($R6="H")+(G6>$E6)*($R6="L")

    However, Excel refuses to let me enter a formula into the Name Manager without the reference to the worksheet being present. To be clear: I want to be able to type =Fail in a cell in a given worksheet (or have it referred to in a format condition) and have the relative reference refer to the cell in that worksheet.

    If anyone knows of a workaround for this I would be most appreciative!

    Cheers,
    Jason

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Creating a relative named range that can be used across more than one worksheet

    can you put the worksheet name into a cell and then reference that using indirect()?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-03-2012
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Excel 2003, 2010
    Posts
    14

    Re: Creating a relative named range that can be used across more than one worksheet

    Thanks, but unfortunately Excel is too 'smart' to be outwitted by that - it insists that even in the indirect you must include the sheet reference...

    To be fair, though - the number of functions required to achieve this solution would have been huge for some of the formulas... the simple example I gave before blows out to:

    =(INDIRECT(A1&"!"&ADDRESS(ROW(I7),COLUMN(I7)))<INDIRECT(A1&"!"&ADDRESS(ROW($E7),COLUMN($E7))))*(INDIRECT(A1&"!"&ADDRESS(ROW($R7),COLUMN($R7)))="H")+(INDIRECT(A1&"!"&ADDRESS(ROW(I7),COLUMN(I7)))>INDIRECT(A1&"!"&ADDRESS(ROW($E7),COLUMN($E7))))*(INDIRECT(A1&"!"&ADDRESS(ROW($R7),COLUMN($R7)))="L")

    Cheers all the same.

+ 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