Bonjour à tous
J'aimerai comprendre comment marche les userform pour pouvoir en faire après toute seule!
!je sais créer le formulaire mais pas la vba pour le faire marcher !
On m'a bien aidé en faisant marché mon formulaire mais je ne sais pas comment il a fait !
Pourriez vous m'expliquer?
Ci joint le code de userform et le programme qui s'y rattache
Private Sub BtnEffacer_Click()
Call Efface_Tout
End Sub
Private Sub BtnQuitter_Click()
Unload Me
End Sub
Private Sub BtnValider_Click()
With Sheets("fournisseur")
Derlign = Range("A65000").End(xlUp).Row + 1
Range("A" & Derlign) = Textbox1
Range("B" & Derlign) = ComboBox1
Range("C" & Derlign) = Application.Proper(Textbox2)
Range("D" & Derlign) = Application.Proper(Textbox3)
Range("E" & Derlign) = TextBox4
Range("F" & Derlign) = TextBox5
Range("G" & Derlign) = Application.Proper(TextBox6)
Range("H" & Derlign) = Format(TextBox7, "0# ## ## ## ##")
Range("I" & Derlign) = Format(TextBox8, "0# ## ## ## ##")
Range("J" & Derlign) = TextBox9
End With
Call Efface_Tout
End Sub
Private Sub Label1_Click()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox6_Change()
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "Usinage"
ComboBox1.AddItem "Beton"
ComboBox1.AddItem "Acier"
ComboBox1.AddItem "Modeleur"
End Sub
Sub Efface_Tout()
Dim Ctl As Control
For Each Ctl In UserForm1.Controls
If TypeName(Ctl) = "Combobox" Then Ctl.Value = ""
If TypeName(Ctl) = "TextBox" Then Ctl.Value = ""
Next Ctl
End Sub
Private Sub Ville_Click()
End Sub
J'aimerai comprendre comment marche les userform pour pouvoir en faire après toute seule!
!je sais créer le formulaire mais pas la vba pour le faire marcher !
On m'a bien aidé en faisant marché mon formulaire mais je ne sais pas comment il a fait !
Pourriez vous m'expliquer?
Ci joint le code de userform et le programme qui s'y rattache
Private Sub BtnEffacer_Click()
Call Efface_Tout
End Sub
Private Sub BtnQuitter_Click()
Unload Me
End Sub
Private Sub BtnValider_Click()
With Sheets("fournisseur")
Derlign = Range("A65000").End(xlUp).Row + 1
Range("A" & Derlign) = Textbox1
Range("B" & Derlign) = ComboBox1
Range("C" & Derlign) = Application.Proper(Textbox2)
Range("D" & Derlign) = Application.Proper(Textbox3)
Range("E" & Derlign) = TextBox4
Range("F" & Derlign) = TextBox5
Range("G" & Derlign) = Application.Proper(TextBox6)
Range("H" & Derlign) = Format(TextBox7, "0# ## ## ## ##")
Range("I" & Derlign) = Format(TextBox8, "0# ## ## ## ##")
Range("J" & Derlign) = TextBox9
End With
Call Efface_Tout
End Sub
Private Sub Label1_Click()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox6_Change()
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "Usinage"
ComboBox1.AddItem "Beton"
ComboBox1.AddItem "Acier"
ComboBox1.AddItem "Modeleur"
End Sub
Sub Efface_Tout()
Dim Ctl As Control
For Each Ctl In UserForm1.Controls
If TypeName(Ctl) = "Combobox" Then Ctl.Value = ""
If TypeName(Ctl) = "TextBox" Then Ctl.Value = ""
Next Ctl
End Sub
Private Sub Ville_Click()
End Sub