Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,538
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code:
It is intended to change the font colour to white when the cell = "AUTO". It does, but it also changes the contents of the cell (like NA, and NR) to white when they aren't equal to AUTO.
I'm not sure where I messed up.
Code:
If .Range("K" & t) = "AUTO" Then
.Range("K" & t) = Format(Application.VLookup(.Range("A" & t), rcore, 54, False), "h:mmA/P")
With .Range("K" & t)
.FormatConditions.Delete
.Font.Color = vbWhite
.Interior.Color = RGB(128, 128, 128)
End With
End If
If .Range("L" & t) = "AUTO" Then
.Range("L" & t) = Format(Application.VLookup(.Range("A" & t), rcore, 57, False), "h:mmA/P")
With .Range("L" & t)
.FormatConditions.Delete
.Font.Color = vbWhite
.Interior.Color = RGB(128, 128, 128)
End With
End If
It is intended to change the font colour to white when the cell = "AUTO". It does, but it also changes the contents of the cell (like NA, and NR) to white when they aren't equal to AUTO.
I'm not sure where I messed up.