XL 2016 Additionné le total des textbox dans userform

dede869

XLDnaute Occasionnel
Bonjour j'ai un userform qui contiens une liste box avec les nom des équipes, lorsque que je sélectionne une équipe, les noms des 4 joueurs s'affiche dans 4 textbox qui a coté de chaque nom il y a des textbox qui sert a entre des chiffre de la 1e partie, j'aimerais pouvoir visualiser le total des 4 pointage de la premiere partie en bas.

Merci de votre aide

André Fillion
 

Pièces jointes

  • Classeur2.xlsm
    45.4 KB · Affichages: 48

Lone-wolf

XLDnaute Barbatruc
Bonjour André :)

Dans listbox_click avant End Sub rajoute pour chaque textbox

On Error Resume Next
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = total1
total2 = Val(TextBox6) + Val(TextBox12) + Val(TextBox18) + Val(TextBox24)
TextBox30 = total2
 
Dernière édition:

dede869

XLDnaute Occasionnel
Bonjour et merci de ton aide mais ca ne fonctionne pas, rien ne s'incrit dans les textbon de total.
Bonjour André :)

Dans listbox_click avant End Sub rajoute pour chaque textbox

On Error Resume Next
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = total1
total2 = Val(TextBox6) + Val(TextBox12) + Val(TextBox18) + Val(TextBox24)
TextBox30 = total2
Bonjour André :)

Dans listbox_click avant End Sub rajoute pour chaque textbox

On Error Resume Next
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = total1
total2 = Val(TextBox6) + Val(TextBox12) + Val(TextBox18) + Val(TextBox24)
TextBox30 = total2
 

Lone-wolf

XLDnaute Barbatruc
Re

C'est normal, il faut supprimer tout les TextBox_Change().Dans la 29 tu as laissé les conditions. Ensuite

VB:
On Error Resume Next
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
total2 = Val(TextBox6) + Val(TextBox12) + Val(TextBox18) + Val(TextBox24)
TextBox30 = total2
total3 = Val(TextBox7) + Val(TextBox13) + Val(TextBox19) + Val(TextBox25)
Texbox31 = total3
total4 = Val(TextBox8) + Val(TextBox14) + Val(TextBox20) + Val(TextBox26)
Texbox32 = total4
total5 = Val(TextBox9) + Val(TextBox15) + Val(TextBox21) + Val(TextBox27)
Texbox33 = total5
total6 = Val(TextBox10) + Val(TextBox16) + Val(TextBox22) + Val(TextBox28)
Texbox34 = total6
End If
End Sub

Private Sub TextBox5_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox11_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox17_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox23_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub
 
Dernière édition:

dede869

XLDnaute Occasionnel
Re

C'est normal, il faut supprimer tout les TextBox_Change().Dans la 29 tu as laissé les conditions. Ensuite

VB:
On Error Resume Next
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
total2 = Val(TextBox6) + Val(TextBox12) + Val(TextBox18) + Val(TextBox24)
TextBox30 = total2
total3 = Val(TextBox7) + Val(TextBox13) + Val(TextBox19) + Val(TextBox25)
Texbox31 = total3
total4 = Val(TextBox8) + Val(TextBox14) + Val(TextBox20) + Val(TextBox26)
Texbox32 = total4
total5 = Val(TextBox9) + Val(TextBox15) + Val(TextBox21) + Val(TextBox27)
Texbox33 = total5
total6 = Val(TextBox10) + Val(TextBox16) + Val(TextBox22) + Val(TextBox28)
Texbox34 = total6
End If
End Sub

Private Sub TextBox5_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox11_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox17_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub

Private Sub TextBox23_AfterUpdate()
total1 = Val(TextBox5) + Val(TextBox11) + Val(TextBox17) + Val(TextBox23)
TextBox29 = Val(total1)
End Sub


Ok ça fonctionne,merci de ton aide.
 

Discussions similaires

Statistiques des forums

Discussions
312 182
Messages
2 086 003
Membres
103 084
dernier inscrit
Hervé30120