Bonjour xxmedxx, bonjour le forum,
Si j'ai bien compris... Le code modifié :
Private Sub TextBox1_Change()
Dim OS As Worksheet
Dim F4 As Worksheet
Dim R As Range
Dim Dernligne As Long
Dim L As Long
Dim CodeRech As String
Set OS = Worksheets("Source")
Set F4 = Worksheets("Feuil4")
If Len(Me.TextBox1.Value) = 8 Then
Set R = F4.Cells.Find(Me.TextBox1.Value, , xlValues, xlWhole)
If R Is Nothing Then
MsgBox "Nº de lot pas trouvé !"
Exit Sub
Else
OS.Unprotect
Dernligne = OS.Cells(Application.Rows.Count, "A").End(xlUp).Row
CodeRech = ComboBox2.Value
Set R = OS.Columns(1).Find(CodeRech, , xlValues, xlWhole)
If Not R Is Nothing Then R.Offset(0, 5).ClearContents
ComboBox2.Value = ""
MsgBox "sortie effectuée"
L = Dernligne + 1
OS.Cells(L, 6).ClearContents
OS.Range("I2:I1051").Copy
OS.Range("D2").PasteSpecial Paste:=xlPasteValues
Call Macro50
Unload Me
OS.Protect
UserForm2.Show
End If
End If
End Sub
Quel est l'intérêt du bouton GO ? Si tu le garde il faut y mettre aussi ce code.