Re : qui peu m'aider en vba pour faire fonctionne les UserForm
Salut job75
J’ai copié le code ou sa merder, la j’ai crée un nouvelle article, il a bugé
et j'ai mis l'activation niveau bas et sa fonctionne trés bien, pour le démarrage.
Merci job75
Private Sub CommandButton4_Click() 'Créer/Modifier
Call Repere
With Sheets("Base")
If IsError(Application.Match(Cherche(ComboBox1), .Range("Fournisseurs"), 0)) _
Then MsgBox "Entrer le fournisseur": ComboBox1 = "": ComboBox1.DropDown: Exit Sub
If ComboBox3 = "" Then MsgBox "Entrer l'article": ComboBox3.SetFocus: Exit Sub
If IsError(Application.Match(Cherche(ComboBox2), .Range("Unité"), 0)) _
Then MsgBox "Entrer l'unité": ComboBox2 = "": ComboBox2.DropDown: Exit Sub
If TextBox4 = "" Then MsgBox "Entrer le nouveau prix HT": TextBox4.SetFocus: Exit Sub
If lig Then
If MsgBox("Modifier les données de cet article ?", 4) = 7 Then Exit Sub
Else
MsgBox "L'article est créé"
lig = IIf(deb, fin, .Range("A65536").End(xlUp).Row) + 1
If lig > 3 Then Intersect(.Range("Base_Articles").Offset(1), Rows(lig)).Insert Shift:=xlDown
Call Bordures(Intersect(.Range("Base_Articles").Offset(1), Rows(lig)))
End If
.Cells(lig, 1) = Trim(ComboBox1)
.Cells(lig, 2) = Trim(Maj(TextBox2))
.Cells(lig, 4) = Trim(ComboBox2)
.Cells(lig, 5) = Replace(TextBox4, ",", ".")
.Cells(lig, 6) = Replace(TextBox5, ",", ".")
.Cells(lig, 7) = IIf(CheckBox1, "X", "")
.Cells(lig, 8) = IIf(Val(Replace(TextBox6, ",", ".")), Replace(TextBox6, ",", "."), "")
.Cells(lig, 10).FormulaR1C1 = "=IF(ISNUMBER(RC[-2]),RC[-2]+RC[-1],"""")"
.Cells(lig, 3) = Trim(ComboBox3)
Call DesArticle
End With
End Sub