JLandrum
05-14-2015, 09:49 AM
I have this code, what I would like it to do is add a cell color when the value is "NH". Thanks for any help
Private Sub CommandButton21_Click()
Dim x, lr, c As Long
lr = Cells(Rows.Count, 3).End(xlUp).Row
Range("D11:D" & lr).ClearContents
c = 0
For x = 11 To lr
If Cells(x, 3).Value > Cells(4, 2).Value Then
Cells(x, 4).Value = "NH"
c = c + 1
End If
Next x
End Sub
Private Sub CommandButton21_Click()
Dim x, lr, c As Long
lr = Cells(Rows.Count, 3).End(xlUp).Row
Range("D11:D" & lr).ClearContents
c = 0
For x = 11 To lr
If Cells(x, 3).Value > Cells(4, 2).Value Then
Cells(x, 4).Value = "NH"
c = c + 1
End If
Next x
End Sub