1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Sub MethodeFind()
Dim k As Integer
Dim c As Range, LigDeb As String
Dim cle As String, CurrString As String
Application.ScreenUpdating = False
'La clé : (21,4) ou (21,5), à toi de voir
cle = Sheets("Menu").Cells(21, 4).Value
'Recherche de la valeur de la cle dans la feuille Resultat et après il copy la ligne où il trouve la clé pour la copier dans la feuille "SousNotif"
With Sheets("Resultat").Range("D4:D" & Split(Sheets("Resultat").UsedRange.Address, "$")(4))
Set c = .Find(cle)
If Not c Is Nothing Then
LigDeb = c.Address
Do
k = c.Row
CurrString = Sheets("Resultat").Cells(k, 4).Value
If CurrString = cle Then
Sheets("Resultat").Rows(k).Copy Sheets("SousNotif").Rows(1)
Set c = .FindNext(c)
End If
Loop While Not c Is Nothing And c.Address <> LigDeb
End If
End With
Set c = Nothing
Application.ScreenUpdating = True
End Sub |