What I’m looking for is a code that will highlight (Yellow Fill) all the non-blank cells in Column B, if there is a non-blank value in the adjacent cell in Column C.
E.g.
If Cell B10 has a value & cell C10 has a value that is equal to "PICKUP" – Then Yellow fill cell B10
If Cell B15 has a value & cell C15 has a value that is equal to "X" - Then No Fill cell B15
If Cell B232 has a value & cell C232 has a value that is equal to "PICKUP" – Yellow fill cell B232
Ignore if no match
Currently 'B' column has a VBA Code as follows =IF(COUNTIF($A:$A,$B9)=0,"X","PICKUP")
Because I have a Header Row, presumably it would need to find and use the range between B9 and the last cell used in Column B
I would like to have just an extra piece of VBA code that would complete this action.
Currently I am running the following code, but it is Highlighting the fields with the wrong information in it, and I just can't figure it out.
Sub HighlightCells()
Dim c As Range
For Each c In Range("B9", Range("B" & Rows.Count).End(xlUp))
If c <> "" And c.Offset(, 1) <> "" Then
c.Interior.Color = 65535
End If
Next c
End Sub
Thank you.
E.g.
If Cell B10 has a value & cell C10 has a value that is equal to "PICKUP" – Then Yellow fill cell B10
If Cell B15 has a value & cell C15 has a value that is equal to "X" - Then No Fill cell B15
If Cell B232 has a value & cell C232 has a value that is equal to "PICKUP" – Yellow fill cell B232
Ignore if no match
Currently 'B' column has a VBA Code as follows =IF(COUNTIF($A:$A,$B9)=0,"X","PICKUP")
Because I have a Header Row, presumably it would need to find and use the range between B9 and the last cell used in Column B
I would like to have just an extra piece of VBA code that would complete this action.
Currently I am running the following code, but it is Highlighting the fields with the wrong information in it, and I just can't figure it out.
Sub HighlightCells()
Dim c As Range
For Each c In Range("B9", Range("B" & Rows.Count).End(xlUp))
If c <> "" And c.Offset(, 1) <> "" Then
c.Interior.Color = 65535
End If
Next c
End Sub
Thank you.