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
| Option Compare Text
Sub Recup_Design()
Dim Fourn As String, Design As String, Deb As String
Dim x As Range
Application.ScreenUpdating = False
Derlig = Range("F" & Rows.Count).End(xlUp).Row
Fourn = Application.InputBox("Quelle fourniture à rechercher ?", "Liste fournitures", , , , , , 2)
With Sheets("FOURNITURES").Range("A1:A" & Derlig)
Set x = .Find(Fourn, lookat:=xlPart)
If Not x Is Nothing Then
Deb = x.Address
Do
Design = Design & Chr(10) & Cells(x.Row, "F")
Set x = .FindNext(x)
Loop While Not x Is Nothing And x.Address <> Deb
End If
End With
If Design <> "" Then
MsgBox Design
Else
MsgBox "Pas de correspondance trouvée"
End If
Set x = Nothing
End Sub |
Partager