1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub Trouve()
Dim FirstAddress As String
Dim LastLig As Long
Dim i As Integer
Dim c As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1")
LastLig = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range("A1:A" & LastLig)
Set c = .Find("Salaire", LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
c.Offset(5, 0).Copy Worksheets("Feuil2").Cells(5 + i, 9)
i = i + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
End If
End With
End With
End Sub |
Partager