KishorKK
Member
Hi Friends,
Sub basics6()
Dim myrng As Object
Dim x As Integer
Set myrng = ThisWorkbook.Sheets("sheet3").Cells(Rows.Count, "c").End(xlUp).Row
For x = 1 To x - 1
For Each myrng In myrng.Cells
If myrng.Value = "Pass" Then
myrng.Interior.Color = "Vbgreen"
Else
myrng.Interior.Color = "vbred"
End If
Next myrng
End Sub
I'm not getting where it is going wrong. Pls help

Sub basics6()
Dim myrng As Object
Dim x As Integer
Set myrng = ThisWorkbook.Sheets("sheet3").Cells(Rows.Count, "c").End(xlUp).Row
For x = 1 To x - 1
For Each myrng In myrng.Cells
If myrng.Value = "Pass" Then
myrng.Interior.Color = "Vbgreen"
Else
myrng.Interior.Color = "vbred"
End If
Next myrng
End Sub
I'm not getting where it is going wrong. Pls help
