Autres code VBA pour le calculede la tva

samia89

XLDnaute Nouveau
bonjour ; tout le mon j'ai besoin de votre aide svp pouvez vous me corriger ce code de calcule PRIX HT TVA TTC sur Userform il me renvois l'erreur suivant N13 'Incompatibilité type : voila le code et je vous joint mon classeur
VB:
Private Sub TextBox20_Change()


TextBox20 = Replace(TextBox20, ".", ",")

    If TextBox20 <> "" And TextBox21 <> "" Then
                     '20 QUATITE          '21 PRIXU
        TextBox22 = CDbl(TextBox20) * CDbl(TextBox21)
        
        'MONTENT tva      'MONTENT HT
        TextBox23 = Round(TextBox22 * CDbl(Me.ComboBox1.Value), 2)
        tva = Round(ht * CDbl(Me.ComboBox1.Value), 2)
        Me.ComboBox1.Value = Format(Me.ComboBox1.Value, "0%")
        TextBox25 = CDbl(TextBox23) + CDbl(TextBox22) '25 TTC


    End If
End Sub
et merci

Private Sub TextBox21_Change()
TextBox21 = Replace(TextBox21, ".", ",")
If TextBox20 <> "" And TextBox21 <> "" Then
        TextBox22 = CDbl(TextBox20) * CDbl(TextBox21)
        TextBox23 = Round(TextBox22 * CDbl(Me.ComboBox1.Value), 2)
        Me.ComboBox1.Value = Format(Me.ComboBox1.Value, "0%")
        TextBox25 = CDbl(TextBox23) + CDbl(TextBox22)

    End If
End Sub
Private Sub UserForm_Initialize()
 
 
 Me.ComboBox1.List = Array("0,19", "0,17")

 End Sub
et merci
 

Pièces jointes

  • seur1.xlsm
    16.1 KB · Affichages: 7

Discussions similaires

Membres actuellement en ligne

Statistiques des forums

Discussions
312 104
Messages
2 085 349
Membres
102 869
dernier inscrit
radyreth