Below is my poor attempt at VBA code based on changing cell value in P14.
When P14 changes to 1 it should trigger, but it doesn't trigger.
If I step through it, it correctly changes the font size and color in cell P15.
How do I need to change this code so it will trigger when P14 changes to 1?
Many thanks in advance!
Sub Formatting()
ThisWorkbook.Worksheets("Progress").Range("$P$14").Select
With ThisWorkbook.Worksheets("Progress").Range("$P$15")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=$P$14=1"
.FormatConditions(1).Interior.ColorIndex = 3 'red
With .Font
.ColorIndex = 27 'color Yellow
.Size = 12
.Bold = True
End With
End With
End Sub
When P14 changes to 1 it should trigger, but it doesn't trigger.
If I step through it, it correctly changes the font size and color in cell P15.
How do I need to change this code so it will trigger when P14 changes to 1?
Many thanks in advance!
Sub Formatting()
ThisWorkbook.Worksheets("Progress").Range("$P$14").Select
With ThisWorkbook.Worksheets("Progress").Range("$P$15")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=$P$14=1"
.FormatConditions(1).Interior.ColorIndex = 3 'red
With .Font
.ColorIndex = 27 'color Yellow
.Size = 12
.Bold = True
End With
End With
End Sub