I seek assistance with the code below.
This is what Norie, one a UA member helped me with and it functions as required.
CODE
Sub ColorCells()
Dim R_From As Integer
Dim R_To As Integer
Dim R As Integer
R_From = 11
R_To = 150
For R = R_From To R_To
Rows(R).Select
If Cells(R, 33) = "HIGH" Or Cells(R, 33) = "MEDIUM" Or Cells(R, 36) = "NON COMPLIANCE" Then
Cells(R, "A").Value = "1"
Selection.Font.Color = vbRed
Else
Selection.Font.Color = vbBlack
End If
Next R
End Sub
Dim R_From As Integer
Dim R_To As Integer
Dim R As Integer
R_From = 11
R_To = 150
For R = R_From To R_To
Rows(R).Select
If Cells(R, 33) = "HIGH" Or Cells(R, 33) = "MEDIUM" Or Cells(R, 36) = "NON COMPLIANCE" Then
Cells(R, "A").Value = "1"
Selection.Font.Color = vbRed
Else
Selection.Font.Color = vbBlack
End If
Next R
End Sub
I want to have the code change the cells range to vbOrange and the value in Cells A to 2. My attempt is below, it obviously does not work?
CODE
Sub ColorCells()
Dim R_From As Integer
Dim R_To As Integer
Dim R As Integer
R_From = 11
R_To = 150
For R = R_From To R_To
Rows(R).Select
If Cells(R, 33) = "HIGH" Or Cells(R, 36) = "NON COMPLIANCE" = Cells(R, "A").Value = "1" = Selection.Font.Color = vbRed _
= Cells(R, 33) = "MEDIUM" Or Cells(R, 36) = "NON COMPLIANCE" = Cells(R, "A").Value = "2" = Selection.Font.Color = vbOrange Then
Else
Selection.Font.Color = vbBlack
End If
Next R
End Sub
Dim R_From As Integer
Dim R_To As Integer
Dim R As Integer
R_From = 11
R_To = 150
For R = R_From To R_To
Rows(R).Select
If Cells(R, 33) = "HIGH" Or Cells(R, 36) = "NON COMPLIANCE" = Cells(R, "A").Value = "1" = Selection.Font.Color = vbRed _
= Cells(R, 33) = "MEDIUM" Or Cells(R, 36) = "NON COMPLIANCE" = Cells(R, "A").Value = "2" = Selection.Font.Color = vbOrange Then
Else
Selection.Font.Color = vbBlack
End If
Next R
End Sub
Many thanks