Laurent,
Encore une petite proposition (attention je ne l'ai pas testé) pour remplacer dans le module ESPECESpage la sub InitializeESP():
- Elle montre l'histoire des boucles + le bon usage des with...end with
Citation:
Sub InitializeESP()
Dim myArray As Variant
Dim i As Integer
myArray = Feuil3.Range('B26:B37').Value
With Accueil_Form
For i = 21 To 32
.Controls('TextBox' & i).Value = CInt(myArray(i - 20, 1))
Next
.FondsCaisseBox.Value = MAJForm(Feuil3.Range('D41').Value)
If .OptionMidi Then
.EcartESPBox.Value = MAJForm(CDbl(Feuil2.Range('B30').Value) - CDbl(.TotalESPBox.Value))
End If
If .OptionSoir Then
.EcartESPBox.Value = MAJForm(CDbl(Feuil2.Range('C30').Value) - CDbl(.TotalESPBox.Value))
End If
End With
End Sub
|
A+