En excel 2000, j'ai réalisé un userform comportant plusieurs textbox.
Pour celle indiquée ci-dessous, le contrôle change fonctionne bien.
Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrôle
afterupdate pour faire revenir le pointeur dans la box même et corriger,
mais cela ne marche pas.
Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change()
If StagiaireTéléphoneFixe.Value > "" And Not _
IsNumeric(StagiaireTéléphoneFixe.Value) Then
Beep
StagiaireTéléphoneFixe.Text = Left(StagiaireTéléphoneFixe.Text,
_
Len(StagiaireTéléphoneFixe.Text) - 1)
End If
End Sub
Private Sub StagiaireTéléphoneFixe_AfterUpdate()
If Len(StagiaireTéléphoneFixe.Text) < 10 Then
Beep
StagiaireTéléphoneFixe.SetFocus
'????????
End If
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
JB
Bonsoir,
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep Cancel = True End If End Sub
JB http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox. Pour celle indiquée ci-dessous, le contrôle change fonctionne bien. Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrô le afterupdate pour faire revenir le pointeur dans la box même et corriger , mais cela ne marche pas. Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change() If StagiaireTéléphoneFixe.Value > "" And Not _ IsNumeric(StagiaireTéléphoneF ixe.Value) Then Beep StagiaireTéléphoneFixe.Text = Left(Stagiair eTéléphoneFixe.Text, _ Len(StagiaireTéléphoneFixe.Te xt) - 1) End If End Sub Private Sub StagiaireTéléphoneFixe_AfterUpdate() If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep StagiaireTéléphoneFixe.SetFocus '???????? End If End Sub
Bonsoir,
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)
If Len(StagiaireTéléphoneFixe.Text) < 10 Then
Beep
Cancel = True
End If
End Sub
JB
http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" <joel.and...@wanadoo.fr> wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox.
Pour celle indiquée ci-dessous, le contrôle change fonctionne bien.
Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrô le
afterupdate pour faire revenir le pointeur dans la box même et corriger ,
mais cela ne marche pas.
Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change()
If StagiaireTéléphoneFixe.Value > "" And Not _
IsNumeric(StagiaireTéléphoneF ixe.Value) Then
Beep
StagiaireTéléphoneFixe.Text = Left(Stagiair eTéléphoneFixe.Text,
_
Len(StagiaireTéléphoneFixe.Te xt) - 1)
End If
End Sub
Private Sub StagiaireTéléphoneFixe_AfterUpdate()
If Len(StagiaireTéléphoneFixe.Text) < 10 Then
Beep
StagiaireTéléphoneFixe.SetFocus
'????????
End If
End Sub
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep Cancel = True End If End Sub
JB http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox. Pour celle indiquée ci-dessous, le contrôle change fonctionne bien. Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrô le afterupdate pour faire revenir le pointeur dans la box même et corriger , mais cela ne marche pas. Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change() If StagiaireTéléphoneFixe.Value > "" And Not _ IsNumeric(StagiaireTéléphoneF ixe.Value) Then Beep StagiaireTéléphoneFixe.Text = Left(Stagiair eTéléphoneFixe.Text, _ Len(StagiaireTéléphoneFixe.Te xt) - 1) End If End Sub Private Sub StagiaireTéléphoneFixe_AfterUpdate() If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep StagiaireTéléphoneFixe.SetFocus '???????? End If End Sub
Joël André
Merci JB, votre routine fonctionne à merveille.
Merci
Joël
"JB" a écrit dans le message de news:
Bonsoir,
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep Cancel = True End If End Sub
JB http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox. Pour celle indiquée ci-dessous, le contrôle change fonctionne bien. Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrôle afterupdate pour faire revenir le pointeur dans la box même et corriger, mais cela ne marche pas. Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change() If StagiaireTéléphoneFixe.Value > "" And Not _ IsNumeric(StagiaireTéléphoneFixe.Value) Then Beep StagiaireTéléphoneFixe.Text = Left(StagiaireTéléphoneFixe.Text, _ Len(StagiaireTéléphoneFixe.Text) - 1) End If End Sub Private Sub StagiaireTéléphoneFixe_AfterUpdate() If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep StagiaireTéléphoneFixe.SetFocus '???????? End If End Sub
Merci JB, votre routine fonctionne à merveille.
Merci
Joël
"JB" <boisgontier@hotmail.com> a écrit dans le message de news:
54b35997-209f-4977-bb15-2c82821c5e0d@q9g2000yqc.googlegroups.com...
Bonsoir,
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)
If Len(StagiaireTéléphoneFixe.Text) < 10 Then
Beep
Cancel = True
End If
End Sub
JB
http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" <joel.and...@wanadoo.fr> wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox.
Pour celle indiquée ci-dessous, le contrôle change fonctionne bien.
Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrôle
afterupdate pour faire revenir le pointeur dans la box même et corriger,
mais cela ne marche pas.
Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change()
If StagiaireTéléphoneFixe.Value > "" And Not _
IsNumeric(StagiaireTéléphoneFixe.Value) Then
Beep
StagiaireTéléphoneFixe.Text = Left(StagiaireTéléphoneFixe.Text,
_
Len(StagiaireTéléphoneFixe.Text) - 1)
End If
End Sub
Private Sub StagiaireTéléphoneFixe_AfterUpdate()
If Len(StagiaireTéléphoneFixe.Text) < 10 Then
Beep
StagiaireTéléphoneFixe.SetFocus
'????????
End If
End Sub
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep Cancel = True End If End Sub
JB http://boisgontierjacques.free.fr/
On 30 nov, 19:25, "Joël André" wrote:
Bonsoir,
En excel 2000, j'ai réalisé un userform comportant plusieurs textbox. Pour celle indiquée ci-dessous, le contrôle change fonctionne bien. Si l'entrée comporte moins de 10 caractères, j'ai tenté le contrôle afterupdate pour faire revenir le pointeur dans la box même et corriger, mais cela ne marche pas. Auriez-vous une solution?
Merci.
Joël
Private Sub StagiaireTéléphoneFixe_Change() If StagiaireTéléphoneFixe.Value > "" And Not _ IsNumeric(StagiaireTéléphoneFixe.Value) Then Beep StagiaireTéléphoneFixe.Text = Left(StagiaireTéléphoneFixe.Text, _ Len(StagiaireTéléphoneFixe.Text) - 1) End If End Sub Private Sub StagiaireTéléphoneFixe_AfterUpdate() If Len(StagiaireTéléphoneFixe.Text) < 10 Then Beep StagiaireTéléphoneFixe.SetFocus '???????? End If End Sub