Sub compareLines()
Application.ScreenUpdating = False
ActiveSheet.Cells(3, 3).Activate
While ActiveCell.Value <> ""
If ActiveCell.Value - ActiveCell.Offset(-1, 0).Value < 0 Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Activate
End If
Wend
Application.ScreenUpdating = True
End Sub
This is my code that I'm currently the error on.
The error is Excel VBA runtime error "13 type mismatch
.
The line the error is on: If ActiveCell.Value - ActiveCell.Offset(-1, 0).Value < 0 Then
This code had worked on previous worksheets, but when I import this macro onto a new worksheet, it doesn't seem to work. All the solution I have found on SO don't seem to apply to my circumstance, so any help on this problem would be greatly appreciated.