Bonjour,
j'ai un code qui ne marche pas. Aidez moi à detecter l'erreur.
Private Sub cb_eff_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
tb_bid.Text = ""
tb_ask.Text = ""
tb_ee.Text = ""
tb_epd.Text = ""
tb_pld.Text = ""
tb_ple.Text = ""
tb_mt.Text = ""
tb_matur.Text = ""
tb_marg.Text = ""
End Sub
Private Sub cb_quit_Click()
End
End Sub
Private Sub cb_val_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim pt1 As Double, pt2 As Double, mg1 As Double, mg2 As Double
b = tb_bid.Value
a = tb_ask.Value
ee = tb_ee.Value
ed = tb_epd.Value
pd = tb_pld.Value
pe = tb_ple.Value
mt = tb_mt.Value
n = tb_matur.Value
g = tb_marg.Value
pt1 = a * (1 + ed * n / 36000) / (1 + pe * n / 36000) - a
mg1 = g * Abs(pt1)
pt2 = b * (1 + pd * n / 36000) / (1 + ee * n / 36000) - b
mg2 = g * Abs(pt2)
If op_Achat = True Then
p = a + pt1 + mg1
cv = p * mt
Else
p = b + pt2 - mg2
cv = p * mt
End If
End Sub
j'ai un code qui ne marche pas. Aidez moi à detecter l'erreur.
Private Sub cb_eff_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
tb_bid.Text = ""
tb_ask.Text = ""
tb_ee.Text = ""
tb_epd.Text = ""
tb_pld.Text = ""
tb_ple.Text = ""
tb_mt.Text = ""
tb_matur.Text = ""
tb_marg.Text = ""
End Sub
Private Sub cb_quit_Click()
End
End Sub
Private Sub cb_val_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim pt1 As Double, pt2 As Double, mg1 As Double, mg2 As Double
b = tb_bid.Value
a = tb_ask.Value
ee = tb_ee.Value
ed = tb_epd.Value
pd = tb_pld.Value
pe = tb_ple.Value
mt = tb_mt.Value
n = tb_matur.Value
g = tb_marg.Value
pt1 = a * (1 + ed * n / 36000) / (1 + pe * n / 36000) - a
mg1 = g * Abs(pt1)
pt2 = b * (1 + pd * n / 36000) / (1 + ee * n / 36000) - b
mg2 = g * Abs(pt2)
If op_Achat = True Then
p = a + pt1 + mg1
cv = p * mt
Else
p = b + pt2 - mg2
cv = p * mt
End If
End Sub