Bonjour les experts ,
J' ai un soucis avec une erreur "typemismatch des lorss que j ' arrive sur cette partie de mon code
[color=#FF0000]
Me.TextBox8 = Round(Me.TextBox2.Value * (1 + (14.5 / 100)), 2) & " €"
Pouvez vous m ' aider a resoudre ce probleme?
Trouver ci dessous le code ma macro en entier:
Private Sub CommandButton1_Click()
Dim MaVal As Double
Dim MaVal1 As Double
Dim myVar As Long
If Me.ComboZone = "" Then
MsgBox "Veuillez saisir la Zone Géographique"
Me.ComboZone.BackColor = &H8080FF
Me.ComboZone.SetFocus
Exit Sub
End If
MaVal = Me.TextBox3.Value * Me.TextBox4.Value * (Me.TextBox5.Value / 5000)
MaVal = Application.WorksheetFunction _
.Ceiling(MaVal, 0.5)
Me.TextBox1.Value = MaVal
MaVal1 = Application.WorksheetFunction _
.Ceiling(Me.TextBox6.Value, 0.5)
If MaVal1 > MaVal Then
MaVal = MaVal1
End If
On Error Resume Next
myVar = 0
myVar = Application.WorksheetFunction _
.Match(MaVal, Worksheets("Shippingprice").Range("A1:A2001"), 0)
On Error GoTo 0
If myVar <> 0 Then
Me.TextBox2 = Round(Sheets("Shippingprice").Cells(myVar, Me.ComboZone.ListIndex + 2), 2)
Me.TextBox2 = Round(Sheets("Shippingprice").Cells(myVar, Me.ComboZone.ListIndex + 2) * (1 - (50 / 100)), 2)
Me.TextBox8 = Round(Me.TextBox2.Value * (1 + (14.5 / 100)), 2) & " €"
Else
MsgBox "Aucune valeur trouvée, le poid limite du price tool est 1000 kg, Veuillez contacter le Commercial DHL!"
End If
If MaVal < 50.01 Then
Me.TextBox9 = "24-48 heures"
Else
Me.TextBox9 = "48-72 heures"
End If
End Sub