Private Sub Calculer_Click()
TTC.Value = Format(CDbl(PU.Value * QTE.Value), "00.00 €")
TTC1.Value = CDbl(PU1.Value) * CDbl(QTE1.Value)
TextQTE.Value = CDbl(QTE.Value) + CDbl(QTE1.Value) ' + CDbl(QTE2.Value) + Val(QTE3.Value) + Val(QTE4.Value)
TextTTC.Value = Format(CDbl(TTC.Value) + CDbl(TTC1.Value), "00.00 €") '+ Val(TTC2.Value) + Val(TTC3.Value) + Val(TTC4.Value)
Remise.Value = Format(CDbl(TextTTC.Value) * CDbl(Taux_Remise.Value), "0.00 €")
TextTTCNet.Value = Format(CDbl(TextTTC.Value) - CDbl(Remise.Value), "00.00 €")
TextHT.Value = Format(Round((TextTTCNet.Value) / 1.18, 2), "00.00 €")
TextTVA.Value = Format(TextTTCNet.Value - TextHT.Value, "00.00 €")
TTC.Visible = True
TTC1.Visible = True
TextQTE.Visible = True
TextTTC.Visible = True
Remise.Visible = True
TextTTCNet.Visible = True
TextHT.Visible = True
TextTVA.Visible = True
Label12.Visible = True
Label10.Visible = True
Label14.Visible = True
Label15.Visible = True
Label9.Visible = True
Label13.Visible = True
End Sub
Private Sub CommandButton3_Click()
' Partie pou vider tous les ComboBox
PRODUIT = "": PRODUIT1 = ""
PU = "": PU1 = "":
Taux_Remise = ""
' Vider tous les textbox
Dim Ctl As MSForms.Control
Dim réponse As Byte
For Each Ctl In Me.Controls
If TypeOf Ctl Is MSForms.TextBox Then
Ctl.Text = ""
End If
Next
réponse = MsgBox(" Voulez-vous Effectuer une nouvelle Recherche ? ", vbYesNo + vbQuestion, "Validation")
If réponse = vbNo Then
Unload Me
End If
End Sub
Private Sub UserForm_Initialize()
With Worksheets("feuil1")
For Each c In .Range("g2:g" & .Range("g65536").End(xlUp).Row)
c = Format(c, "0 %")
Taux_Remise.AddItem c
Next c
PRODUIT.List = .Range("A2:A" & .Range("A65536").End(xlUp).Row).Value
PRODUIT1.List = .Range("A2:A" & .Range("A65536").End(xlUp).Row).Value
PU.List = .Range("D2:D" & .Range("D65536").End(xlUp).Row).Value
PU1.List = .Range("D2:D" & .Range("D65536").End(xlUp).Row).Value
Taux_Remise.List = .Range("G2:G" & .Range("G65536").End(xlUp).Row).Value
' Ils deviendront visible quand on aura appuyé sur Calculer
TTC.Visible = False
TTC1.Visible = False
TextQTE.Visible = False
TextTTC.Visible = False
Remise.Visible = False
TextTTCNet.Visible = False
TextHT.Visible = False
TextTVA.Visible = False
Label12.Visible = False
Label10.Visible = False
Label14.Visible = False
Label15.Visible = False
Label9.Visible = False
Label13.Visible = False
End With
End Sub