NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 431
- Office Version
- 365
Hi all,
I am having trouble getting the following cleanup code to work:
Column B has several values ranging from "0" to "999999999" and "AAAAAAAAA", but i want all rows deleted unless Cell B of that specific row contains a value between "1000" and "9999".
Am i doing something wrong?
I am having trouble getting the following cleanup code to work:
Code:
Dim i As Integer
For i = 2 To Range("A" & "65536").End(xlUp).Row Step 1
LResult = Len(Range("B" & i).Value)
If LResult < 4 Or LResult > 4 Then
Range("B" & i).EntireRow.Delete
End If
Next i
Column B has several values ranging from "0" to "999999999" and "AAAAAAAAA", but i want all rows deleted unless Cell B of that specific row contains a value between "1000" and "9999".
Am i doing something wrong?