+ Reply to Thread
Results 1 to 7 of 7

Can you copy conditional formatting to a different worksheet?

  1. #1
    Registered User
    Join Date
    07-12-2007
    Posts
    40

    Can you copy conditional formatting to a different worksheet?

    Hello all!!

    I just put in a condition on Excel 2007 and I was wondering if I could just copy it onto another worksheet or if I have to type it all over again?

    It would be awesome if I could link the condition to another worksheet... if anybody knows, please let me know!!

    Thank you!

    Kevin K.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by KRayKeeling
    Hello all!!

    I just put in a condition on Excel 2007 and I was wondering if I could just copy it onto another worksheet or if I have to type it all over again?

    It would be awesome if I could link the condition to another worksheet... if anybody knows, please let me know!!

    Thank you!

    Kevin K.
    Don't know whether things have changed with XL2007 but in older versions you can't use conditional formats which refer to other worksheets or workbooks.

    However you could write your own pseudo conditional format using some VBA code.

    Rgds

  3. #3
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    Hi,

    You cant use conditional formats which refer to other worksheets or workbooks, but you can copy them from one to another.

    You can choose "paste formats" from the edit menu or just use the format painter icon.
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    You can Conditionaly format a cell based on data from other sheets using Named Ranges

    If name: MyCell RefersTo: Sheet2!$A$1

    and the Conditional formatting for Sheet1!B2 is =(myCell=3) then Sheet1 B2 will be highlited whenever Sheet2!$A$1 is 3.

    You can also use relative/absolute refernecing in the name definition.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by mikerickson
    You can Conditionaly format a cell based on data from other sheets using Named Ranges

    If name: MyCell RefersTo: Sheet2!$A$1

    and the Conditional formatting for Sheet1!B2 is =(myCell=3) then Sheet1 B2 will be highlited whenever Sheet2!$A$1 is 3.

    You can also use relative/absolute refernecing in the name definition.
    Thanks for that - you learn something every day.

    Does this apply across workbooks or just worksheets?

    Rgds

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The problem across workbooks is the scope of the name. Scope is not what the name refers to, but which sheets/workbooks recognize the name as a referenced name.

    If a name (myRange) is scoped at the worksheet level, then the formula =INDEX(myRange,1,1) will return that value when placed in a cell on that sheet. On a different sheet, that formula will return a #NAME error.

    Names can be scoped to a worksheet, a workbook (the default) or to the whole application.

    I haven't tested the across workbooks Condidtional Formatting, but if it does work, the name would have to be scoped at the Application level.

    I know 2007 has better control of scoping names than my 2004, but the only way I know of scoping a name at the Application level requires VB.

    Edit: On further thought, using a Name to refer to an INDIRECT might be a work-around .. must test.
    Last edited by mikerickson; 03-22-2008 at 04:23 PM.

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

    In Workbook1.xls, I defined
    Name: otherBook RefersTo: =INDIRECT("[Workbook2.xls]Sheet1!$A$1")
    (note that otherBook is scoped as a Workbook1 name, formulas in Workbook2 cannot reference otherBook.)

    and then conditionaly formatted a cell with =(otherBook=1).

    The conditional formatting worked. With some odd behaviour.

    Closing Workbook2, leaving Workbook1 open, and the cell formatting did not change.

    However, closing the application and opening Workbook1, but not Workbook2, the name refreshed to an error, and the cell showed the un-conditioned formatting.

+ 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