I have a project and on it I must had to check if on the same line, "I" is empty "k" must be empty too. And if not I paint backgroud on red.
I do that code. Not crash but no effect too …
Sub JK()
Dim count As Integer
Dim emptyJ As Boolean
Dim emptyK As Boolean
count = 1
While count = 999
emptyJ = isEmpty(Cells(count, J).Value)
emptyK = isEmpty(Cells(count, K).Value)
If emptyJ = True Then
If emptyK = False Then
Range(Cells(J, count), Cells(K, count)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Else
End If
Else
End If
count = count + 1
Wend
End Sub
While count <= 999. -- Debugging VBA Code