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(CodeARechercher As String)
Dim Code As Range, Magasin As Range, F1 As Worksheet, c As Range, m As Range
Set F1 = Sheets("Feuille 1")
Set Code = F1.Range("A2:A" & F1.Range("A" & Rows.Count).End(xlUp).Row)
Set Magasin = F1.Range("D2:D" & F1.Range("D" & Rows.Count).End(xlUp).Row)
Set c = Code.Find(CodeARechercher, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
Article = c.Cells.Offset(0, 1)
Set m = Magasin.Find(Article, LookIn:=xlValues, lookat:=xlWhole)
If Not m Is Nothing Then
Box.Text = m.Cells.Offset(0, 1)
c.Cells.Offset(0, 2) = m.Cells.Offset(0, 1)
Else
Box.Text = "Magasin non trouvé"
End If
Else
Box.Text = "Code non trouvé"
End If
Delai CInt(Tempo.Text)
Box.Text = ""
CodeBarre.Text = ""
CodeBarre.SetFocus
End Sub |
Partager