I have a prodedure that imports a text file and performs a heap of manual "clean-up" tasks for me. It was developed by a fellow member of IE but today it has bugged for the first time due to a source data issue that I cannot fix. Thanks to a customer!!!
Can someone please help me insert a method that looks for any instance of " - " inside a date column (26 or 27), then if found, delete the entire row and move on to the next step of code?
I have enclosed the current code to help with solving this issue.
ProgressStatus.ProgressBar1.Value = 60
'~~> Perform final clean up
'Check for any instances of " - " in columns 26 or 27
'if found, delete the entire row.
Set xCell = Columns(26).Find(What:=" - ", LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
If Not xCell Is Nothing Then
lastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = lastRow To 1 Step -1
If UCase(Trim(Range("N" & i))) = ("FREE INTO STORE") _
Or UCase(Trim(Range("O" & i))) = ("F.I.") _
Or DateDiff("D", Range("AA" & i), Date) >= 365 _
Or Len(Trim(Range("AF" & i))) = 0 _
Or Len(Trim(Range("AI" & i))) = 0 Then 'column AI = order quantity
If delRange Is Nothing Then
Set delRange = Range("N" & i)
Set delRange = Union(delRange, Range("N" & i))
ProgressStatus.ProgressBar1.Value = 70