Hello,
We are trying to add a text from B4 if in G4 has the value 1
But we can't manage to change the 1 to OK
Can someone helpme please
see here
How we can do that.
We using 365 in windows excel
Thank you
Hello,
We are trying to add a text from B4 if in G4 has the value 1
But we can't manage to change the 1 to OK
Can someone helpme please
see here
How we can do that.
We using 365 in windows excel
Thank you
Hello again Ghost,
Conditional formatting can't add text to a cell.
> Updated 10/13 @10am; plus added a sample file
You can't use a traditional "IF" because it has 2 outcomes - True and False. In CF rules, the formula must only equate to True.
However, you can apply conditional formatting to G4 in a couple of ways. You apply it based on B4 value by the use formula method =$B$4 = "OK". Or based on the value in G4 - cell value contains. This would require using an in-cell formula in G4 =IF(B4="OK", "OK", 1). This method restricts G4 to being "OK" or 1 (or whatever you wish).
An easy way to check the formula result for the use formula method is to enter it ( B4 = "OK" ) into a worksheet cell and see if it returns the result you need (True or False)
You can change the value in G4 using a Worksheet_Change event (VBA method for those who want to use VBA):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$B$4" Then Exit Sub
If Target.Value = "OK" Then
Range("G4").Value = "OK"
Else: Range("G4").Value = 1
End If
End Sub
In the attahed file there are 2 methods of cell contains and 1 for use formula method.
Hope this helps, if so, please mark my answer as Select
Cheers :-)