VBA - Problème de MultiPage (Userform)

Fermé
zivodul8 Messages postés 230 Date d'inscription jeudi 19 novembre 2009 Statut Membre Dernière intervention 19 mai 2015 - 28 juin 2011 à 10:00
zivodul8 Messages postés 230 Date d'inscription jeudi 19 novembre 2009 Statut Membre Dernière intervention 19 mai 2015 - 28 juin 2011 à 16:37
Bonjour,

J'ai un souci avec un formulaire, ou plutôt son code et je pense que cela vient de l'utilisation d'un MultiPage.

C'est la première que j'utilise un MultiPage et je dois dire que je maîtrise pas vraiment. Mes bugs proviennent de rafraichissement de Label dans le code de mon UserForm. Voici mon code :

Option Explicit

Private Sub MultiPage1_Change()

End Sub

Private Sub UserForm_Initialize()

UserForm1.Label1.Caption = ""
UserForm1.Label2.Caption = ""
UserForm1.Label3.Caption = ""
UserForm1.Label4.Caption = ""
UserForm1.N1 = ""
UserForm1.P1 = ""
UserForm1.N2 = ""
UserForm1.P2 = ""

UserForm1.Label11.Caption = ""
UserForm1.Label12.Caption = ""
UserForm1.Label18.Caption = ""
UserForm1.Label10.Caption = ""
UserForm1.Eff1 = ""
UserForm1.Note1 = ""
UserForm1.Eff2 = ""
UserForm1.Note2 = ""

End Sub

'POURCENTAGES'

Private Sub CommandButton1_Click()
Call TestSignifPourcent
End Sub

Private Sub N1_Change()
Label1.Caption = Range(N1.Text).Value
End Sub

Private Sub P1_Change()
Label2.Caption = Range(P1.Text).Value * 100 & "%"
End Sub

Private Sub N2_Change()
Label3.Caption = Range(N2.Text).Value
End Sub

Private Sub P2_Change()
Label4.Caption = Range(P2.Text).Value * 100 & "%"
End Sub

'NOTES'

Private Sub CommandButton2_Click()
Call TestSignifNote
End Sub

Private Sub Eff1_Change()
Label11.Caption = Range(Eff1.Text).Value
End Sub

Private Sub Note1_Change()
Label12.Caption = Range(Note1.Text).Value * 100 & "%"
End Sub

Private Sub Eff2_Change()
Label18.Caption = Range(Eff2.Text).Value
End Sub

Private Sub Note2_Change()
Label10.Caption = Range(Note2.Text).Value * 100 & "%"
End Sub


Je signale qu'auparavant (sans le MultiPage), je n'avais que les pourcentages et mon code fonctionné très bien.

Merci d'avance !

3 réponses

zivodul8 Messages postés 230 Date d'inscription jeudi 19 novembre 2009 Statut Membre Dernière intervention 19 mai 2015 22
28 juin 2011 à 15:35
Personne ne voit le problème?
0
bonjour,

= Range(Eff1.Text).Value
= Range(Note1.Text).Value
= Range(Eff2.Text).Value


que représente Eff1.Text, Note1.Text ... ?

des TextBox ?

si oui pas besoin de range, si non ... ben ...

A+
0
zivodul8 Messages postés 230 Date d'inscription jeudi 19 novembre 2009 Statut Membre Dernière intervention 19 mai 2015 22
28 juin 2011 à 16:37
En réalité ce sont des RefEdit qui vont permettent d'allé chercher les valeurs dans la cellule sélectionnée par l'utilisateur. Quand aux labels ils servent à afficher la valeur de la cellule sélectionnée dans le formulaire.

J'espère avoir été clair :S
0