Set the color of one cell based on the color of another cell

后端 未结 4 353
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 21:54

What I would like to have is:

IF   A1 in Sheet 2 is blue  
Then A1 in Sheet 1 changes to blue

I know I can get the color of A1 in Sheet 2 b

4条回答
  •  时光说笑
    2020-12-21 22:20

    Not recommended because of reliance on the XLM (not XML) Macro function GET.CELL. This from a technology introduced 30 years ago that was effectively superseded eight years later. With almost all its elements now defunct, the few that remain can be expected to have a low life expectancy. Microsoft encourages migration to VBA.

    Nevertheless, you have asked ‘how’ rather than ‘why not’, so I suggest you proceed from where you have reached and select Sheet1 A1 and HOME > Styles - Conditional Formatting - New Rule..., Use a formula to determine which cells to format, Format values where this formula is true:

    =CellColor=23  
    

    and select blue formatting of your choice, OK, OK, Apply.

    23 is a fairly standard number for Blue (not Light, not Dark) but your configuration may expect a different number.

    Note that another disadvantage is that, unlike CF in general, the response is not automatic – you may need to enter something in Sheet1 A1, or Shift+F9 to force an update.


    If your data is spread across two sheets (Sheet1 and Sheet2, both ColumnA) and there is a 1:1 relationship (the p-value in A1 of Sheet2 is that for the correlation coefficient in A1 of Sheet1) then a simple Conditional Formatting rule may suffice:

    Select Sheet1 ColumnA and HOME > Styles - Conditional Formatting, New Rule...

    Use a formula to determine which cells to format
    Format values where this formula is true:

    =Sheet2!A1>0.05
    

    Format..., select dark blue or to suit, OK, OK.

    The same rule might be applied in Sheet2 (ColumnA) in the same way so the cells (by row) conditionally formatted in one sheet are those conditionally formatted in the other.

提交回复
热议问题