Private Sub CommandButton1_Click()
'--- Positionnement dans la base
[d65000].End(xlUp).Offset(1, 0).Select
'--- Transfert Formulaire dans BD
ActiveCell.Value = Application.Proper(Me.p1)
ActiveCell.Offset(0, 1).Value = Format(Me.p2, "0.00")
ActiveCell.Offset(0, 2).Value = Format(Me.p3, "0.00")
ActiveCell.Offset(0, 4).Value = Format(Me.p4, "0.00")
ActiveCell.Offset(0, 3).Value = Format(Me.TextBox1, "0.00")
ActiveCell.Offset(0, 5).Value = Format(Me.TextBox2, "0.00")
ActiveCell.Offset(0, 6).Value = Format(Me.TextBox3, "0.00")
' Me.TextBox1.Value = ActiveCell.Offset(1, -1).Value
'Label1.Caption = Selection.Cells.Offset(1, -1).Value
ActiveCell.Offset(1, -1).Select
'Me.TextBox1.Value = Selection
Me.Label1.Caption = Selection
' ActiveCell.Offset(0, 3).Value = Me.num
p1.Value = ""
p2.Value = ""
p3.Value = ""
p4.Value = ""
p1.SetFocus
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub p1_Change()
If Not ((KeyAscii >= 46 And KeyAscii <= 57) Or KeyAscii = 8) Then
KeyAscii = 0
End If
End Sub
Private Sub p2_Change()
If Not ((KeyAscii >= 46 And KeyAscii <= 57) Or KeyAscii = 8) Then
KeyAscii = 0
End If
End Sub
Private Sub p3_Change()
TextBox1.Value = Format((Val(Val(p1) + Val(p2) + Val(p3)) / 3) * 2, "0.00")
If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then
KeyAscii = 0
End If
End Sub
Private Sub p4_Change()
TextBox2.Value = Val(Val(p4) * 3)
TextBox3.Value = Val(Val(TextBox1) + Val(TextBox2)) / 5
If Not ((KeyAscii >= 46 And KeyAscii <= 57) Or KeyAscii = 8) Then
KeyAscii = 0
End If
End Sub
Private Sub UserForm_Initialize()
'TextBox1.Visible = False
'TextBox2.Visible = False
'TextBox3.Visible = False
p1.SetFocus
[d65000].End(xlUp).Offset(1, 0).Select
End Sub