Forum Discussion

RuthC2809's avatar
RuthC2809
Copper Contributor
Mar 09, 2021

conditional formatting based on colour of another cell

Hi,

 

Thanks in advanced to anyone who is able to help. 

I am trying to get a cell's colour to inform the text in another cell. For example is B2 is green, C3 will say "a" (and longer text in other scenarios). I have used =IF(CellColour=4,"a","x") but it does not automatically update when i change the colour back to white. 

The idea is staff will be able to right click on the cells which are relevant to the job to turn them green and on another sheet the text will automatically appear (I've already programmed right click to turn cells green). For example B2 in sheet one may say 4 x 4 and if that cell is green then in Sheet 2, cell A2 will say "A 4 x 4 will be needed to access site."

 

Any help would be much appreciated.

6 Replies

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    RuthC2809 

    Here are some examples in the inserted file to see how many possibilities there are with the conditional formatting.

     

    If you liked this information / answer, please mark it as the best answer and thumbs up :-), so other members of this forum can also benefit from it.

     

    Wish you a nice day.

     

    Nikolino

    I know I don't know anything (Socrates)

    • RuthC2809's avatar
      RuthC2809
      Copper Contributor

      thanks for the document. It's all good stuff but I don't think it answers my query. NikolinoDE 

      • NikolinoDE's avatar
        NikolinoDE
        Platinum Contributor

        RuthC2809 

        Here is an example with VBA.

        If double click on cell with left mouse button then red.

        If you click right mouse button then green.

         

         

        Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
            Target.Interior.Color = vbRed
        End Sub
        Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
            Target.Interior.Color = vbGreen
        End Sub

         

         

         

        I would be happy to know if I could help.

         

        Nikolino

        I know I don't know anything (Socrates)

Resources