B
bony_tony
Hi,
Someone has given me the following code for my previous post.
But i'm getting an error. It's highlighting "Application", and says
"Expected: Then or GoTo"
firstRowFound = True
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 6 To lastRow
If Not Iserror Application.Match(Range("D" & i), _
Worksheets('All Invoices').Columns(4),0)) Then
If firstRowFound = True Then
Rows(i).Select
firstRowFound = False
Else
Union(Selection, Rows(i)).Select
End If
End If
Next i
Selection.Delete Shift:=xlShiftUp
It looks ok to me, there's a "Then" at the end of the statement....
Any ideas?
Tony
Someone has given me the following code for my previous post.
But i'm getting an error. It's highlighting "Application", and says
"Expected: Then or GoTo"
firstRowFound = True
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 6 To lastRow
If Not Iserror Application.Match(Range("D" & i), _
Worksheets('All Invoices').Columns(4),0)) Then
If firstRowFound = True Then
Rows(i).Select
firstRowFound = False
Else
Union(Selection, Rows(i)).Select
End If
End If
Next i
Selection.Delete Shift:=xlShiftUp
It looks ok to me, there's a "Then" at the end of the statement....
Any ideas?
Tony