Salut,
encore un GRAND GRAND MERCI Eric, j'avance grace a toi.
Je voulais m'excuser d'avoir ete un peu absent du forum mais j'ai eu d'autres choses sur le feu.
Je reviens a mon probleme. ca marche super mais quand je rentre par exemple un montant de 340,45€, il arrondi a 340€
et si le montant est de 340,56€ alors j'obtiens 341€.
Peux tu encore m'aider?
voici le code:
Private Sub CommandButton1_Click()
Dim lig As Long
If IsDate(TbxDate) And (IsNumeric(TbxDébit) Or IsNumeric(TbxCrédit)) Then
lig = Range("A65536").End(xlUp).Row + 1
Cells(lig, "A") = CDate(TbxDate)
Cells(lig, "B") = CbxCateg
If IsNumeric(TbxDébit) Then
Cells(lig, "C") = CLng(TbxDébit)
Cells(lig, "C").NumberFormat = "_-* #,##0.00 [$€-40C]_-;-* #,##0.00 [$€-40C]_-;_-* ""-""?? [$€-40C]_-;_-@_-"
Else
Cells(lig, "D") = CLng(TbxCrédit)
Cells(lig, "D").NumberFormat = "_-* #,##0.00 [$€-40C]_-;-* #,##0.00 [$€-40C]_-;_-* ""-""?? [$€-40C]_-;_-@_-"
End If
TbxDébit = ""
TbxCrédit = ""
Else
MsgBox "Saisie incomplète"
End If
End Sub
Private Sub TextBox6_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
If IsNumeric(Me.TextBox6) Then t = CDbl(Me.TextBox6)
End Sub
Private Sub TextBox7_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub UserForm_Click()
End Sub
ENCORE UN GRAND MERCI.
Chris