J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit ,
j'aimerai pouvoir réduire la programation, mais j'avoue que je suis
complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA
(TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une autre
txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change()
If CB1 = True And TXTVA1 > 0 Then
TextBox1 = 1
Else
If CB1 = False And TXTVA1 <> 0 Then
TextBox1 = ""
End If
End If
End Sub
Private Sub Cb1_Click()
If CB1 = False Then TXTVA1 = ""
If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196
If CB1 = True Then TextBox1 = 1
End Sub
Je traiterais ton fichier avec des modules de classe
Diminution du code mais aurait besoin de plus de détails
Envoie le fichier sans données confidentielles sur
Je te monte le fichier
Mytå
JB
Bonjour,
http://cjoint.com/?jCio2oRBfU
Module de classe:
Public WithEvents GrCB As MSForms.CheckBox Private Sub GrCB_Click() UserForm1.calcul Mid(GrCB.Name, 3) End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB Private Sub UserForm_Initialize() For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b End Sub
Sub calcul(b) If Me("CB" & b) = False Then Me("TxtVa" & b) = "" If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) * 0.196 If Me("CB" & b) = True Then Me("TextBox" & b) = 1 End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit , j'aimerai pouvoir réduire la programation, mais j'avoue que je suis complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA (TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change() If CB1 = True And TXTVA1 > 0 Then TextBox1 = 1 Else If CB1 = False And TXTVA1 <> 0 Then TextBox1 = "" End If End If End Sub
Private Sub Cb1_Click() If CB1 = False Then TXTVA1 = "" If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196 If CB1 = True Then TextBox1 = 1 End Sub
Bonjour,
http://cjoint.com/?jCio2oRBfU
Module de classe:
Public WithEvents GrCB As MSForms.CheckBox
Private Sub GrCB_Click()
UserForm1.calcul Mid(GrCB.Name, 3)
End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB
Private Sub UserForm_Initialize()
For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b
End Sub
Sub calcul(b)
If Me("CB" & b) = False Then Me("TxtVa" & b) = ""
If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) *
0.196
If Me("CB" & b) = True Then Me("TextBox" & b) = 1
End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit ,
j'aimerai pouvoir réduire la programation, mais j'avoue que je suis
complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA
(TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre
txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change()
If CB1 = True And TXTVA1 > 0 Then
TextBox1 = 1
Else
If CB1 = False And TXTVA1 <> 0 Then
TextBox1 = ""
End If
End If
End Sub
Private Sub Cb1_Click()
If CB1 = False Then TXTVA1 = ""
If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196
If CB1 = True Then TextBox1 = 1
End Sub
Public WithEvents GrCB As MSForms.CheckBox Private Sub GrCB_Click() UserForm1.calcul Mid(GrCB.Name, 3) End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB Private Sub UserForm_Initialize() For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b End Sub
Sub calcul(b) If Me("CB" & b) = False Then Me("TxtVa" & b) = "" If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) * 0.196 If Me("CB" & b) = True Then Me("TextBox" & b) = 1 End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit , j'aimerai pouvoir réduire la programation, mais j'avoue que je suis complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA (TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change() If CB1 = True And TXTVA1 > 0 Then TextBox1 = 1 Else If CB1 = False And TXTVA1 <> 0 Then TextBox1 = "" End If End If End Sub
Private Sub Cb1_Click() If CB1 = False Then TXTVA1 = "" If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196 If CB1 = True Then TextBox1 = 1 End Sub
JB
Bonjour,
http://cjoint.com/?jCitrutdSk
Module de classe:
Public WithEvents GrCB As MSForms.CheckBox Private Sub GrCB_Click() UserForm1.calcul Mid(GrCB.Name, 3) End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB Private Sub UserForm_Initialize() For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b End Sub
Sub calcul(b) If Me("CB" & b) = False Then Me("TxtVa" & b) = "" If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) * 0.196 If Me("CB" & b) = True Then Me("TextBox" & b) = 1 End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit , j'aimerai pouvoir réduire la programation, mais j'avoue que je suis complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA (TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change() If CB1 = True And TXTVA1 > 0 Then TextBox1 = 1 Else If CB1 = False And TXTVA1 <> 0 Then TextBox1 = "" End If End If End Sub
Private Sub Cb1_Click() If CB1 = False Then TXTVA1 = "" If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196 If CB1 = True Then TextBox1 = 1 End Sub
Bonjour,
http://cjoint.com/?jCitrutdSk
Module de classe:
Public WithEvents GrCB As MSForms.CheckBox
Private Sub GrCB_Click()
UserForm1.calcul Mid(GrCB.Name, 3)
End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB
Private Sub UserForm_Initialize()
For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b
End Sub
Sub calcul(b)
If Me("CB" & b) = False Then Me("TxtVa" & b) = ""
If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) *
0.196
If Me("CB" & b) = True Then Me("TextBox" & b) = 1
End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit ,
j'aimerai pouvoir réduire la programation, mais j'avoue que je suis
complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA
(TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre
txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change()
If CB1 = True And TXTVA1 > 0 Then
TextBox1 = 1
Else
If CB1 = False And TXTVA1 <> 0 Then
TextBox1 = ""
End If
End If
End Sub
Private Sub Cb1_Click()
If CB1 = False Then TXTVA1 = ""
If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196
If CB1 = True Then TextBox1 = 1
End Sub
Public WithEvents GrCB As MSForms.CheckBox Private Sub GrCB_Click() UserForm1.calcul Mid(GrCB.Name, 3) End Sub
Userform1:
Dim CB(1 To 3) As New ClasseCB Private Sub UserForm_Initialize() For b = 1 To 3: Set CB(b).GrCB = Me("CB" & b): Next b End Sub
Sub calcul(b) If Me("CB" & b) = False Then Me("TxtVa" & b) = "" If Me("CB" & b) = True Then Me("TxtVa" & b) = Val(Me("TxtM" & b)) * 0.196 If Me("CB" & b) = True Then Me("TextBox" & b) = 1 End Sub
Cordialement JB
Bonsoir à toutes et à tous,
J'ai dans un userform 45 textbox et 45 checkbox à programmer comme suit , j'aimerai pouvoir réduire la programation, mais j'avoue que je suis complétment perdue.......
En fait avec ce programme je veux dire que s'il y a un montant de TVA (TXTVA) il me coche la checkbox (CB) et inscrit le code TVA 1 dans une au tre txt.
J'epère avoir été assez claire....
Merci pour votre aide.
Private Sub TXTVA1_Change() If CB1 = True And TXTVA1 > 0 Then TextBox1 = 1 Else If CB1 = False And TXTVA1 <> 0 Then TextBox1 = "" End If End If End Sub
Private Sub Cb1_Click() If CB1 = False Then TXTVA1 = "" If CB1 = True Then TXTVA1 = Val(TXTM1) * 0.196 If CB1 = True Then TextBox1 = 1 End Sub