[color=darkblue]Sub[/color] Delete_Rows()
[color=darkblue]Dim[/color] A, B, r&
[color=darkblue]Dim[/color] Dict [color=darkblue]As[/color] [color=darkblue]Object[/color]
[color=darkblue]With[/color] Sheets("Sheet1")
r = .Range("A" & Rows.Count).End(xlUp).Row
[color=darkblue]If[/color] r = 1 [color=darkblue]Then[/color]
[color=darkblue]ReDim[/color] A(1 [color=darkblue]To[/color] 1, 1 [color=darkblue]To[/color] 1)
A(1, 1) = .Range("A1").Value
[color=darkblue]Else[/color]
A = .Range("A1:A" & r).Value
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]End[/color] [color=darkblue]With[/color]
[color=darkblue]Set[/color] Dict = CreateObject("Scripting.Dictionary")
Dict.CompareMode = 1
[color=darkblue]For[/color] r = 1 [color=darkblue]To[/color] [color=darkblue]UBound[/color](A, 1)
Dict(A(r, 1)) = r
[color=darkblue]Next[/color] r
[color=darkblue]With[/color] Sheets("Sheet2")
B = .Range("E1", .Range("E" & Rows.Count).End(xlUp)).Value
[color=darkblue]End[/color] [color=darkblue]With[/color]
Application.ScreenUpdating = [color=darkblue]False[/color]
[color=darkblue]For[/color] r = [color=darkblue]UBound[/color](B, 1) To 1 [color=darkblue]Step[/color] -1
[color=darkblue]If[/color] [color=darkblue]Not[/color] Dict.exists(B(r, 1)) [color=darkblue]Then[/color] Sheets("Sheet2").Rows(r).Delete
[color=darkblue]Next[/color] r
Application.ScreenUpdating = [color=darkblue]True[/color]
End [color=darkblue]Sub[/color]