[RESOLVED] color change the entire rows
hi!
i am trying to do if the column 3 is blank and other coloumns 1 , 2 have values the entire row will be yellow color
column 1 is text and column 2 will be variant and column 3 also vairant
but the below will get error type mismatch.
Code:
If ActiveSheet.Cells(i, 1).Text And ActiveSheet.Cells(i, 2).Text And ActiveSheet.Cells(i, 3).Text = "" Then ''color because was late
Range(Cells(i, 1), Cells(i, 3)).Interior.ColorIndex = 36 '
End If
Re: color change the entire rows
You can't just place a String value (.Text) in an If statement without any conditions - you need to put something for it to check.
You could make sure that it doesn't equal an empty string:
Code:
If ActiveSheet.Cells(i, 1).Text <> "" And ...
...or that it is Not equal to an empty string:
Code:
If Not(ActiveSheet.Cells(i, 1).Text = "") And ...