Cynthia Zone
New Member
Hello,
I am trying to add another criteria to my macro below. I need to delete any rows with numbers less than 5 digits. Can you please help me with the code.
This is what I have now.
Thank you
I am trying to add another criteria to my macro below. I need to delete any rows with numbers less than 5 digits. Can you please help me with the code.
This is what I have now.
Code:
Sub DeleteRowsNotCheques()
Columns("B").Replace "dep*", "#N/A", xlPart
Columns("B").Replace "dd*", "#N/A", xlPart
Columns("B").Replace "P*", "#N/A", xlPart
Columns("B").Replace "XXX*", "#N/A", xlPart
Columns("B").Replace "", "#N/A", xlPart
Columns("B").Replace "Transfer", "#N/A", xlPart
On Error Resume Next
Columns("B").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
On Error GoTo 0
Columns("C").Replace "", "#N/A", xlPart
On Error Resume Next
Columns("C").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
On Error GoTo 0
End Sub
Last edited by a moderator: