Sub DelRw()
Dim LR As Long, i As Long
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
With Range("A" & i)
If Len(.Value) < 5 Or Len(.Value) > 40 Then .Delete shift:=xlShiftUp
End With
Next i
Application.ScreenUpdating = True
End Sub