Sub DeleteRow()
Dim lngRowCount1 As Long
lngRowCount1 = Worksheets("Sheet1").UsedRange.Rows.Count
Dim lngRowCount2 As Long
lngRowCount2 = Worksheets("Sheet2").UsedRange.Rows.Count
Dim lngIdx1, lngIdx2, lngQty As Long
lngQty = 0
For lngIdx1 = 1 To lngRowCount1
For lngIdx2 = 1 To lngRowCount2
If Worksheets("Sheet1").Cells(lngIdx1, 1).Value = Worksheets("Sheet2").Cells(lngIdx2, 1).Value Then
Worksheets("Sheet1").Rows(lngIdx1).Delete
lngQty = lngQty + 1
End If
Next
Next
MsgBox (CStr(lngQty) + " row(s) has been deleted")
End Sub
Dim lngRowCount1 As Long
lngRowCount1 = Worksheets("Sheet1").UsedRange.Rows.Count
Dim lngRowCount2 As Long
lngRowCount2 = Worksheets("Sheet2").UsedRange.Rows.Count
Dim lngIdx1, lngIdx2, lngQty As Long
lngQty = 0
For lngIdx1 = 1 To lngRowCount1
For lngIdx2 = 1 To lngRowCount2
If Worksheets("Sheet1").Cells(lngIdx1, 1).Value = Worksheets("Sheet2").Cells(lngIdx2, 1).Value Then
Worksheets("Sheet1").Rows(lngIdx1).Delete
lngQty = lngQty + 1
End If
Next
Next
MsgBox (CStr(lngQty) + " row(s) has been deleted")
End Sub