Option Explicit
Dim Ligne As Long
Dim Msg As String
Private Sub Opb100_Click()
Me.TbMontant.Visible = False
Me.LbMontant.Visible = False
With Range("I" & Ligne)
.Value = 1
.NumberFormat = "00 %"
End With
Columns("I").AutoFit
End Sub
Private Sub OpbCB_Click()
Me.TbMontant.Visible = True
Me.LbMontant.Visible = True
Msg = "CB: "
With Range("I" & Ligne)
.Value = Msg & Format(Replace(Me.TbMontant, ".", ","), "#,##0.00 €")
.NumberFormat = "@"
End With
Columns("I").AutoFit
End Sub
Private Sub OpbChèque_Click()
Me.TbMontant.Visible = True
Me.LbMontant.Visible = True
Msg = "Chq: "
With Range("I" & Ligne)
.Value = Msg & Format(Replace(Me.TbMontant, ".", ","), "#,##0.00 €")
.NumberFormat = "@"
End With
Columns("I").AutoFit
End Sub
Private Sub TbMontant_Change()
With Range("I" & Ligne)
.Value = Msg & Format(Replace(Me.TbMontant, ".", ","), "#,##0.00 €")
.NumberFormat = "@"
End With
Columns("I").AutoFit
End Sub
Private Sub TbMontant_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr(1, "0123456789.,", Chr(KeyAscii)) = 0 And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub UserForm_Initialize()
Ligne = ActiveCell.Row
Me.TbMontant.Visible = False
Me.LbMontant.Visible = False
Me.LbLigne.Caption = "Ligne " & Ligne
End Sub