Faire Tourner des données (TextBox dans les Module UserForms)

cs_erlab Messages postés 15 Date d'inscription mardi 22 juin 2004 Statut Membre Dernière intervention 12 juin 2009 - 12 août 2004 à 16:39
ShadowWisp Messages postés 113 Date d'inscription jeudi 1 juillet 2004 Statut Membre Dernière intervention 25 août 2004 - 12 août 2004 à 17:06
Bonjour,

Merci de me venir en aide car je voudrai faire tourner plusieurs valeurs Text dans plusieurs " TextBox " .

Le nom du module UserForm1

Les textBox au nombre de 3 se Nomme TextBox1, TextBox2, TextBox3.
Et un bouton Tourne.

Voici ma formule qui ne fonctionne pas :
UserForm1.TextBox1 = UserForm1.TextBox2
UserForm1.TextBox2 = UserForm1.TextBox3
UserForm1.TextBox3 = UserForm1.TextBox1

Le but du bouton " Tourne " est de faire tourner indéfiniment les valeurs à chaque click sur le Bouton.

Exenple :
TextBox1 = a
TextBox2 = b
TextBox3 = C
Quand je clique sur Tourne
TextBox1 = b
TextBox2 = c
TextBox3 = a
et ainsi de suite.....

Voici le Code Exporter

VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} UserForm1
Caption = "UserForm1"
ClientHeight = 3225
ClientLeft = 45
ClientTop = 330
ClientWidth = 4710
OleObjectBlob = "UserForm1.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "UserForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CommandButton1_Click()
Range("D4") = UserForm1.TextBox1
Range("D5") = UserForm1.TextBox2
Range("D6") = UserForm1.TextBox3
End Sub

Private Sub CommandButton2_Click()
UserForm1.TextBox1 = UserForm1.TextBox2
UserForm1.TextBox2 = UserForm1.TextBox3
UserForm1.TextBox3 =
End Sub

Private Sub UserForm_Activate()
UserForm1.Personne1 = Range("C4").Text
UserForm1.Personne2 = Range("C5").Text
UserForm1.Personne3 = Range("C6").Text
End Sub

D'avance Merci pour l'aide,
Cordialement, Erlab...

3 réponses

ShadowWisp Messages postés 113 Date d'inscription jeudi 1 juillet 2004 Statut Membre Dernière intervention 25 août 2004 1
12 août 2004 à 16:52
UserForm1.TextBox1.value = UserForm1.TextBox2.value
UserForm1.TextBox2 .value= UserForm1.TextBox3.value
UserForm1.TextBox3.value = UserForm1.TextBox1.value

Mais ca ne marchera quand meme pas
Il faut que tu fasses

Dim temp as string
temp=trim$(userform1.textbox1.value)
UserForm1.TextBox1.value = UserForm1.TextBox2.value
UserForm1.TextBox2 .value= UserForm1.TextBox3.value
UserForm1.TextBox3.value = temp

A.
0
cs_erlab Messages postés 15 Date d'inscription mardi 22 juin 2004 Statut Membre Dernière intervention 12 juin 2009
12 août 2004 à 17:03
Merci ShadowWisp

Je te confirme que ça fonctionne avec Dim temp......

@+ sur le Forum.!!!!
0
ShadowWisp Messages postés 113 Date d'inscription jeudi 1 juillet 2004 Statut Membre Dernière intervention 25 août 2004 1
12 août 2004 à 17:06
Valides la réponse, si ca marche, histoire que ca serve a quelqu'un d'autre :)

A.
0
Rejoignez-nous