Bonjour,
J'ai un problème avec mes variables "nblg" et "cel" , j'ai essayé diverses solutions avec ce que j'ai trouvé sur le divers site mais rien de rien ! un problème résolu en amène un autre et un autre !! et tout ça dans un petite parcelle de code....
Private Sub CommandButton1_Click()
'vérifier le stock
Me.TextBox2 = ""
If Me.ComboBox1.ListIndex = -1 Then
MsgBox "veuillez choisir une famille"
Exit Sub
End If
If Me.ComboBox2.ListIndex = -1 Then
MsgBox "Veuillez choisir un nom"
Exit Sub
End If
If Me.ComboBox3.ListIndex = -1 Then
MsgBox "veuillez choisir une couleur"
Exit Sub
End If
If Me.ComboBox4.ListIndex = -1 Then
MsgBox "veuillez choisir une pièce"
Exit Sub
End If
[b] Application.ScreenUpdating = False
With Sheets("Base")
nblg = .Range("A" & Rows.Count).End(xlUp).Row
With .Range("E3:E" & nblg)
.Formula = "=A3&B3&C3&D3"
.Value = .Value
End With
Set cel = .Columns("E").Find(what:=Me.ComboBox1 & Me.ComboBox2 & Me.ComboBox3 & Me.ComboBox4, LookIn:=xlValues, lookat:=xlWhole)
If Not cel Is Nothing Then
Me.TextBox2 = cel.Offset(0, 0)
End If
.Columns("E").ClearContents
End With[/b]
End Sub
Je laisse mon fichiers joints.
http://www.fichier-xls.fr/2015/11/11/gestion-stock-pd-transit/
Qulelqu'un peut-il m'aider ?
Le but est qu'il m'affiche dans le userform la quantité en fonction de mes choix dans les combobox.
Merci d'avance
Vianney