A voir également:
- Drame code VBA
- Code ascii - Guide
- Code activation windows 10 - Guide
- Code puk bloqué - Guide
- Comment déverrouiller un téléphone quand on a oublié le code - Guide
- Scanner qr code pc - Guide
2 réponses
Ca marche pas voici les codes Userform et module
code Userform
Private Sub CommandButton1_Click()
'Fermeture du formulaire
UserForm1.Hide
End Sub
Private Sub TextBox1_Introw()
Cells(ligne, 1) = TextBox1
End Sub
Private Sub TextBox2_Introw()
Cells(ligne, 2) = TextBox2
End Sub
Private Sub TextBox3_Introw()
Cells(ligne, 3) = TextBox3
End Sub
Private Sub TextBox4_Introw()
Cells(ligne, 4) = TextBox4
End Sub
Private Sub TextBox5_Introw()
Cells(ligne, 5) = TextBox5
End Sub
Private Sub TextBox6_Introw()
Cells(ligne, 6) = TextBox6
End Sub
Private Sub TextBox7_Introw()
Cells(ligne, 7) = TextBox7
End Sub
Private Sub TextBox8_Introw()
Cells(ligne, 8) = TextBox8
End Sub
Private Sub UserForm_Activate()
'Réinitialisation des champs du formulaire
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
End Sub
code module
'Définition de deux variables publiques
'Une pour la ligne et l'autre pour la colonne pour placer le curseur
'où l'on souhaite
Public ligne, colonne
Sub Bouton11_QuandClic()
'Initialisation des variables pour placer le curseur en A2
ligne = 2
colonne = 1
'Selection de la première cellule du tableau
Range("A2").Select
'Boucle itérative pour rouver la première cellule vide
Do Until IsEmpty(Cells(ligne, colonne))
'Incrémentation de la variale ligne (si non vide)
ligne = ligne + 1
Loop
'Selection de la première cellule cide trouvée
Cells(ligne, colonne).Select
'Affichage du formulaire
UserForm1.Show
End Sub
code Userform
Private Sub CommandButton1_Click()
'Fermeture du formulaire
UserForm1.Hide
End Sub
Private Sub TextBox1_Introw()
Cells(ligne, 1) = TextBox1
End Sub
Private Sub TextBox2_Introw()
Cells(ligne, 2) = TextBox2
End Sub
Private Sub TextBox3_Introw()
Cells(ligne, 3) = TextBox3
End Sub
Private Sub TextBox4_Introw()
Cells(ligne, 4) = TextBox4
End Sub
Private Sub TextBox5_Introw()
Cells(ligne, 5) = TextBox5
End Sub
Private Sub TextBox6_Introw()
Cells(ligne, 6) = TextBox6
End Sub
Private Sub TextBox7_Introw()
Cells(ligne, 7) = TextBox7
End Sub
Private Sub TextBox8_Introw()
Cells(ligne, 8) = TextBox8
End Sub
Private Sub UserForm_Activate()
'Réinitialisation des champs du formulaire
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
End Sub
code module
'Définition de deux variables publiques
'Une pour la ligne et l'autre pour la colonne pour placer le curseur
'où l'on souhaite
Public ligne, colonne
Sub Bouton11_QuandClic()
'Initialisation des variables pour placer le curseur en A2
ligne = 2
colonne = 1
'Selection de la première cellule du tableau
Range("A2").Select
'Boucle itérative pour rouver la première cellule vide
Do Until IsEmpty(Cells(ligne, colonne))
'Incrémentation de la variale ligne (si non vide)
ligne = ligne + 1
Loop
'Selection de la première cellule cide trouvée
Cells(ligne, colonne).Select
'Affichage du formulaire
UserForm1.Show
End Sub
il y a 3 Userform dans mon fichier un par feuil
création de 3 Userform et de 3 modules
le problème est que quand je remplis les textbox les valeurs ne s'affiche pas dans ma feuil
voici le lien du fichier
et merci
http://www.cijoint.fr/cjlink.php?file=cj200811/cijQa6m1W1.xls