1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub TextBox_ht_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'Si la valeur de textbox_ht est un nombre sans virgule alors on rajoute la virgule et deux 0
Dim vResult_ht As Variant, montant As String
If TextBox_ht.Value = "" Then
Else
'vResult_ht = Replace(TextBox_ht.Value, ".", ",")
'vResult_ht = CDbl(vResult_ht)
vResult_ht = CDbl(Val(TextBox_ht.Value)) 'passage d'une chaine string en une valeur de type double si un nombre est rentré dans la textbox
TextBox_ht = IIf(IsNumeric(vResult_ht), Format(vResult_ht, "###0.00"), "")
TextBox_ht = Replace(TextBox_ht, ",", ".")
End If
If (OptionButton_lot.Value = True) Then
min_max (montant_ht) 'changer pour une fonction
ElseIf (OptionButton_bon_commande.Value = True) Then
min_max() = montant_ht 'changer pour une fonction
Else
montant_ht = TextBox_ht 'changer pour une fonction
End If
End Sub |