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
| Option Explicit
Sub Test()
Dim c As Range
Dim Trouve As Boolean
Dim firstAddress As String
Dim Resultat As Double
With Worksheets("Feuil1").Range("C:C")
Set c = .Find("MotCherché", LookIn:=xlValues)
If Not c Is Nothing Then
Trouve = True
firstAddress = c.Address
Do
Resultat = c.Offset(0, 5) 'montant se trouvant a droite de 5 cellules
MsgBox "Résultat : " & Resultat
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
If Trouve Then
MsgBox "Fin de traitement"
Else
MsgBox "Aucun mot trouvé"
End If
End With
End Sub |
Partager