Merci pour vos réponses, mais cela ne fonctionne pas.
Car Excel est en anglais, et il me faut un séparateur de décimal en point. Pour des raisons de compatibilité entre ordinateurs, j'ai enlevé tout format nombre dans mon code. Lorsque j'écris un point cela fonctionne, mais cela ne fonctionne pas pour la division.
Je pense que ca doit jouer dans ma division mais y-a-t-il une façon que cela fonctionne ?
Merci pour vos retours,
Je vous mets une partie du code :
Private Sub TextBox17_AfterUpdate()
Dim i As Integer
Dim StartMonth As String, NextMonth As String
Dim Montant As Long
Dim Divide As Integer
Dim ctr As Object
StartMonth = ComboBox4.Value
Montant = Me.TextBox9.Value
Divide = TextBox17.Value
Select Case StartMonth
Case "January"
i = 24
Case "February"
i = 25
Case "March"
i = 26
Case "April"
i = 27
Case "May"
i = 28
Case "June"
i = 29
Case "July"
i = 30
Case "August"
i = 31
Case "September"
i = 32
Case "October"
i = 33
Case "November"
i = 34
Case "December"
i = 35
End Select
NextMonth = i + Divide - 1
If NextMonth >= 36 Then
MsgBox ("This value is not allowed.")
ElseIf Divide > 12 Then
MsgBox ("This value is not allowed.")
Else
For Each ctr In Me.Controls
If ctr.Name Like "TxtBox*" Then
ctr.Value = "0"
End If
Next
For i = i To NextMonth
Controls("TxtBox" & i).Value = Val(Montant / Divide)
Next
End If
TextBox23.Value = TextBox9.Value
End Sub