J'ai modifié une boucle dans le programme et cela fonctionne :
With Sheets("Rapport")
.TextBox4.Value = Cells(24, 4).Value
.TextBox5.Value = Cells(25, 4).Value
.TextBox6.Value = Cells(26, 4).Value
.TextBox7.Value = Cells(27, 4).Value
.TextBox8.Value = Cells(28, 4).Value
.TextBox9.Value = Cells(29, 4).Value
.TextBox10.Value = Cells(30, 4).Value
.TextBox11.Value = Cells(31, 4).Value
.TextBox12.Value = Cells(32, 4).Value
.TextBox13.Value = Cells(33, 4).Value
.TextBox14.Value = Cells(21, 7).Value
.TextBox15.Value = Cells(22, 7).Value
.TextBox16.Value = Cells(23, 7).Value
.TextBox17.Value = Cells(24, 7).Value
.TextBox18.Value = Cells(25, 7).Value
.TextBox19.Value = Cells(26, 7).Value
.TextBox20.Value = Cells(27, 7).Value
.TextBox21.Value = Cells(28, 7).Value
.TextBox22.Value = Cells(29, 7).Value
.TextBox23.Value = Cells(30, 7).Value
.TextBox24.Value = Cells(31, 7).Value
.TextBox25.Value = Cells(32, 7).Value
.TextBox26.Value = Cells(33, 7).Value
.TextBox27.Value = Cells(21, 7).Value
.TextBox28.Value = Cells(22, 10).Value
.TextBox29.Value = Cells(23, 10).Value
.TextBox30.Value = Cells(24, 10).Value
.TextBox31.Value = Cells(25, 10).Value
.TextBox32.Value = Cells(26, 10).Value
.TextBox33.Value = Cells(27, 10).Value
.TextBox34.Value = Cells(28, 10).Value
.TextBox35.Value = Cells(29, 10).Value
.TextBox36.Value = Cells(30, 10).Value
.TextBox37.Value = Cells(31, 10).Value
.TextBox38.Value = Cells(32, 10).Value
For Each Obj In .OLEObjects
If TypeOf Obj.Object Is MSForms.TextBox Then
i = Val(Right(Obj.Name, 1))
For i = 3 To 39
If Obj.Object.Value < -0.05 Or Obj.Object.Value > 0.05 Then
Obj.Object.ForeColor = RGB(255, 0, 0)
ElseIf Obj.Object.Value >= -0.05 And Obj.Object.Value < 0 Then
Obj.Object.ForeColor = RGB(0, 255, 0)
ElseIf Obj.Object.Value > 0 And Obj.Object.Value <= 0.05 Then
Obj.Object.ForeColor = RGB(0, 0, 255)
ElseIf Obj.Object.Value = 0 Then
Obj.Object.ForeColor = RGB(0, 0, 0)
End If
Next i
End If
Next
End With
End Sub
Si j'ai fait une erreur, vous pouvez me modifier.