I created this VBA code:
Code:Sub macro1()
Dim i As Long, Texto As String, j As Long
For i = 1 To Range("K65536").End(xlUp).Row
Range("K" & i).Select
Select Case ActiveCell.Value
Case 0
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "Ok"
Case Is < 0
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "Under"
Case Else
Texto = Range("B" & i).Value & Range("D" & i).Value
With Sheets("Class 2")
For j = 2 To .Range("A65536").End(xlUp).Row
If (.Range("A" & j).Value & .Range("B" & j).Value) = Texto _
And .Range("D" & j).Value = 0 Then
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "Above"
Exit For
End If
Next j
End With
End Select
Next i
Range("K1").Select
End Sub
But its TOO slow. It takes 1 sec per row and as my sheet has 22,000 rows its TOO much.
Can anyone help me to optimize it?
:banghead: :banghead: