In Sheet1
there is one number in A3
(which is not always the same)
In Sheet2
, I want to delete the entire row where column A contains the same value as Sheet1!A3
(in blue):
With a different number:
As before, we delete the row:
...and so on.
Here is my code, but nothing happened; no error, but no rows deleted.
Dim rng As Range
Dim WB As Workbook
Dim i As Integer
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
Set rng = WB.Sheets("Données Enregistrées").Range("B:B").Find(What:=WB.Sheets("Modification").Range("A3"), _
LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
While Not rng Is Nothing
rng.Rows("Modification").EntireRow.Delete
Set rng = WB.Sheets("Données Enregistrées").Range("B:B").Find(What:=WB.Sheets("Modification").Range("A3"), _
LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
Wend
Application.ScreenUpdating = True