I have a Conditional format for Range: E7:F90
The formula is
If True Shades the G:C cell in a color
I'm trying to setup a macro and was able to find something that partially works. It does color my true statements, but it also highlights cells that are false
The formula is
Excel Formula:
=IF(INT((G7-C7)*24)<=4,TRUE,FALSE)
If True Shades the G:C cell in a color
I'm trying to setup a macro and was able to find something that partially works. It does color my true statements, but it also highlights cells that are false
VBA Code:
Sub setCondFormat()
Range("E7").Select
With Range("E7:F90")
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(INT((G7-C7)*24)<=4,TRUE,FALSE)"
With .FormatConditions(.FormatConditions.Count)
.SetFirstPriority
With .Interior
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
End With
End With
End With
End Sub
A7 | B7 | C7 | D7 | E7 | F7 | G7 |
Job | Name | Start Time | End Time | |||
Example | PersonA | 9:00 | COLOR | COLOR | 11:00 |