OVH Cloud OVH Cloud

userform = legere err de saisi

3 réponses
Avatar
Lo
Bjr =E0 tous,


Ci desous le code de mon userform dont voici le probl=E8me:=20


Je souhaiterai qu'arp=E8s la saisie apparaissent dans les=20
colonnes A =E0 G ligne 5 (puis 6 etc) les donn=E9es saisies=20
tout b=E9tement :)
La premi=E8re saisi fonctionne cependant les suivantes ne=20
fonctionne pas ... J'ai remarqu=E9 que lorsque je saisissai=20
des valeurs num=E9riques, un nombre de ligne =E9quivalente=20
=E9taient cr=E9=E9es.=20

voici le code :

Private Sub Valider_Click()
Dim namej As String
Dim postep As String
Dim postej As String
Dim taille As String
Dim expc As String
Dim expp As String
Dim nivoatein As String
Dim nivoactuel As String


On Error GoTo Err
namej =3D TBnamej.Value
postep =3D TBpostep.Value
postej =3D TBpostej.Value
taille =3D TBtaille.Value
expc =3D TBexpc.Value
expp =3D TBexpp.Value
nivoatein =3D TBnivoatein.Value
nivoactuel =3D TBnivoactuel.Value

ligne =3D Sheets("Feuil1").Range("D5").End(xlUp).Row + 1
Worksheets(1).Activate
For N =3D 1 To taille
Cells(ligne, 1).Value =3D namej
Cells(ligne, 2).Value =3D postep
Cells(ligne, 3).Value =3D postej
Cells(ligne, 4).Value =3D taille
Cells(ligne, 5).Value =3D expc
Cells(ligne, 6).Value =3D expp
Cells(ligne, 7).Value =3D nivoatein
Cells(ligne, 8).Value =3D nivoactuel
ligne =3D ligne + 1
=20
Next
TBnamej =3D ""
TBpostep =3D ""
TBpostej =3D ""
TBtaille =3D ""
TBexpc =3D ""
TBexpp =3D ""
TBnivoatein =3D ""
TBnivoactuel =3D ""


Exit Sub
Err:
MsgBox "Erreur"

End Sub

Private Sub Sortie_Click()
Unload SaisiJoueur
End Sub


Ce que je souhaite :
un formulaire de saisi avec 8 choix :

nom=20
postep =3D de 1 =E0 6 + le choix "P"
postej =3D idem que ci dessus
taille =3D en cm soit un choix num=E9rique de 110 =E0 230
expc =3D de 0 =E0 100
expp =3D idem=20
nivoatein =3D PRO A / PRO B / N1 / N2 / N3 / R1 / R2 / R3 /=20
D1 D2
nivoactuel =3D idem.


J'espere avoir =E9t=E9 le plus clair possible mais j'ai de=20
s=E9rieux doute :/
Merci d'avance =E0 vous pour tous pour votre aide ;)

3 réponses

Avatar
Lo
petite rectification :

Private Sub Valider_Click()
Dim namej As String
Dim postep As String
Dim postej As String
Dim taille As String
Dim expc As String
Dim expp As String
Dim nivoatein As String
Dim nivoactuel As String


On Error GoTo Err
namej = TBnamej.Value
postep = TBpostep.Value
postej = TBpostej.Value
taille = TBtaille.Value
expc = TBexpc.Value
expp = TBexpp.Value
nivoatein = TBnivoatein.Value
nivoactuel = TBnivoactuel.Value

ligne = Sheets("Feuil1").Range("D5").End(xlUp).Row + 1
Worksheets(1).Activate
Cells(ligne, 1).Value = namej
Cells(ligne, 2).Value = postep
Cells(ligne, 3).Value = postej
Cells(ligne, 4).Value = taille
Cells(ligne, 5).Value = expc
Cells(ligne, 6).Value = expp
Cells(ligne, 7).Value = nivoatein
Cells(ligne, 8).Value = nivoactuel
ligne = ligne + 1

Exit Sub
Err:
MsgBox "Erreur"

End Sub


Ce code marche bien mieux!
seule soucis, la saisi se fait à chaque fois sur la même
ligne. Apparement la boucle ne fonctionne pas... une
idée?:)
Avatar
Ellimac
Bonjour,

La ligne suivante te permettra de récupérer le n° de la
dernière ligne remplie en D et d'y ajouter 1 :
ligne = Sheets("Feuil1").Range("D65536").End(xlUp).Row + 1

Camille

-----Message d'origine-----
petite rectification :

Private Sub Valider_Click()
Dim namej As String
Dim postep As String
Dim postej As String
Dim taille As String
Dim expc As String
Dim expp As String
Dim nivoatein As String
Dim nivoactuel As String


On Error GoTo Err
namej = TBnamej.Value
postep = TBpostep.Value
postej = TBpostej.Value
taille = TBtaille.Value
expc = TBexpc.Value
expp = TBexpp.Value
nivoatein = TBnivoatein.Value
nivoactuel = TBnivoactuel.Value

ligne = Sheets("Feuil1").Range("D5").End(xlUp).Row + 1
Worksheets(1).Activate
Cells(ligne, 1).Value = namej
Cells(ligne, 2).Value = postep
Cells(ligne, 3).Value = postej
Cells(ligne, 4).Value = taille
Cells(ligne, 5).Value = expc
Cells(ligne, 6).Value = expp
Cells(ligne, 7).Value = nivoatein
Cells(ligne, 8).Value = nivoactuel
ligne = ligne + 1

Exit Sub
Err:
MsgBox "Erreur"

End Sub


Ce code marche bien mieux!
seule soucis, la saisi se fait à chaque fois sur la même
ligne. Apparement la boucle ne fonctionne pas... une
idée?:)
.



Avatar
Lo
Exact, merci camille !

-----Message d'origine-----
Bonjour,

La ligne suivante te permettra de récupérer le n° de la
dernière ligne remplie en D et d'y ajouter 1 :
ligne = Sheets("Feuil1").Range("D65536").End(xlUp).Row + 1

Camille

-----Message d'origine-----
petite rectification :

Private Sub Valider_Click()
Dim namej As String
Dim postep As String
Dim postej As String
Dim taille As String
Dim expc As String
Dim expp As String
Dim nivoatein As String
Dim nivoactuel As String


On Error GoTo Err
namej = TBnamej.Value
postep = TBpostep.Value
postej = TBpostej.Value
taille = TBtaille.Value
expc = TBexpc.Value
expp = TBexpp.Value
nivoatein = TBnivoatein.Value
nivoactuel = TBnivoactuel.Value

ligne = Sheets("Feuil1").Range("D5").End(xlUp).Row + 1
Worksheets(1).Activate
Cells(ligne, 1).Value = namej
Cells(ligne, 2).Value = postep
Cells(ligne, 3).Value = postej
Cells(ligne, 4).Value = taille
Cells(ligne, 5).Value = expc
Cells(ligne, 6).Value = expp
Cells(ligne, 7).Value = nivoatein
Cells(ligne, 8).Value = nivoactuel
ligne = ligne + 1

Exit Sub
Err:
MsgBox "Erreur"

End Sub


Ce code marche bien mieux!
seule soucis, la saisi se fait à chaque fois sur la même
ligne. Apparement la boucle ne fonctionne pas... une
idée?:)
.

.