Home > Mobile >  Change the value of the cell according to the font colour of the other cell
Change the value of the cell according to the font colour of the other cell

Time:06-17

I would like to know how to change the value of the cell depending on the font color of the other cell. In three adjacent columns (a,b,c) I have three different values, on one of the cells I have a value with green font.

I would like to make a condition that depending on which cell contains text/values with green font I can select the column where this text is located:

enter image description here

I've tried to crate a function to find the color of the font then tried to use this function in a if statement but it doesn't work. This is the function

Function IsColor(lColor As Long, cl As Range) As Boolean
If cl.Font.ColorIndex = lColor Then
    IsColor = True
Else
    IsColor = False
End If
End Function

Can someone enlighten me on how I should go about this?

CodePudding user response:

Using your function the following might solve your issue:

The find method is illustrated here: enter image description here

  • Related