1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub recherche()
With Worksheets(1).Range("a1:a500")
Set c = .Find("café", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Offset(0, 1).Value = "N/A" Then c.Offset(0, 1).Value = "5"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
With Worksheets(1).Range("a1:a500")
Set c = .Find("lait", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Offset(0, 1).Value = "N/A" Then c.Offset(0, 1).Value = "1"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub |
Partager