Bonjour
Private Sub TextBox11_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
'Handle if they entered a % sign already
If Not Right(Me.TextBox11.Value, 1) = "%" Then
If Me.TextBox11.Value >= 1 Then
Me.TextBox11.Value = Format(Me.TextBox3.Value / 100, "0.00%")
Else
Me.TextBox11.Value = Format(Me.TextBox3.Value, "0.00%")
End If
End If
End Sub
Private Sub CommandButton1_Click()
Dim qty As Long 'Quantity
Dim discPct As Single 'Discount Percentage
Dim unitPrice As Single 'Single Normal Price
Dim discPrice As Single 'Single Price After Discount
Dim total As Single 'Total Qty * Discounted Single Price
qty = CSng(TextBox4.Text)
unitPrice = CSng(TextBox5.Text)
discPct = CSng(Replace(TextBox11.Text, "%", "")) / 100
discPrice = (qty * discPct * unitPrice)
TextBox6.Value = discPrice
Me.TextBox6.Text = Format(Me.TextBox6.Text, "#,###,###.00")
TextBox89.Value = val(TextBox4.Value) * val(TextBox5.Value) - CDbl(val(TextBox6.Value))
End Sub