Hi Tony,
Try replacing:
> If Not Iserror Application.Match(Range("D" & i), _
> Worksheets('All Invoices').Columns(4),0)) Then
with
If Not IsError(Application.Match(Range("D" & i).Value, _
Worksheets("All Invoices").Columns(4), 0)) Then
--
---
Regards,
Norman
"bony_tony" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
|