Avoiding ActiveCell and defining the range through you should loop should be as easy as this one:
Sub IfColor()
    Dim myCell As Range
    
    Dim wks As Worksheet
    Set wks = Worksheets("Sheet1")  'write the name of the worksheet
    
    Dim lastRow As Long
    lastRow = 20 'or find a suitable way to define the last row
    
    With wks
        For Each myCell In .Range(.Cells(1, "S"), .Cells(lastRow, "S"))
            If myCell.Interior.Color = vbGreen Then
                myCell = "YES"
            End If
        Next myCell
    End With
    
End Sub
If the idea is to check 2 columns, for example Q and R, whether one of them is vbGreen, then OR in the condition should return the following result:

If myCell.Offset(columnoffset:=-1).Interior.Color = vbGreen Or myCell.Offset(columnoffset:=-2).Interior.Color = vbGreen Then
The idea is that myCell.Offset(columnoffset:=-1).Interior.Color checks column R and columnoffset:=-2 is responsible for Q.