Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message oups.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Drop down list options dependent on cell value | Excel Discussion (Misc queries) | |||
Delete rows if value from cell is not in list | Excel Programming | |||
How do I delete the drop down list of header / footer options in e | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
Delete a list of rows | Excel Programming |