I want to find in an array/range if one or more cells have red background color. The output to be returned in a cell outside of range. I don’t have any VBA experience and this is all I came up with so far:
Sub MacroTest()
Dim rng As Range
rng = Range("k2:014") 'the array/range/
i As Object 'the cell
For Each i In rng 'looping through the range
If i.Interior.Color = 255 Then
Range("c5").Value = "red" 'the output value will be asigned to a cell outside of range
Exit For
End If
Next i
End Sub
New contributor
Gabriel K is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.