Sub Delete_Matches()
Dim wb As Workbook
Set wb = Workbooks.Open("C:UsersWolfieeeStyleDesktop1.xls")
Set ws = wb.Worksheets.Item(1)
With ws
Application.ScreenUpdating = False
Range("A1").EntireColumn.Insert
Range("A1").CurrentRegion.Columns(1).FormulaR1C1 = "=RC[5]=RC[6]"
Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:="TRUE"
With ActiveSheet.AutoFilter.Range
On Error Resume Next
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Delete
On Error GoTo 0
End With
ActiveSheet.AutoFilterMode = False
Range("A1").EntireColumn.Delete
Application.ScreenUpdating = True
End With
wb.Save
wb.Close
End Sub
Hi Experts,
looking for a macro correction
Plz remove the on error resume next line in this macro
The line On Error Resume Next is there to ensure that you won't get an error message if there are no rows that satisfy the AutoFilter condition. Why do you want to remove it?