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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Private Sub CommandButton1_Click()
Dim s As Worksheet
For Each s In Sheets
' Ici le code sur chaque feuille
Dim FL1 As Worksheet, critere As String
Set FL1 = Worksheets("Feuil1")
Set c = Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
On Error GoTo erreur
If c = "" Then
UserForm1.Hide
End If
c.Activate 'active la cellule trouvée
Stock = ActiveCell.Offset(0, 0).Value 'décale pour trouver le stck
TextBox2.Value = Stock
Dim FL1 As Worksheet, critere As String
Set FL1 = Worksheets("Feuil2")
Set c = Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
On Error GoTo erreur
If c = "" Then
UserForm1.Hide
End If
c.Activate 'active la cellule trouvée
Stock = ActiveCell.Offset(0, 0).Value 'décale pour trouver le stck
TextBox2.Value = Stock
Next
erreur:
End Sub |
Partager