salut,
voila j'ai ecrit ce code vba pour avoir un formulaire dynamque qui calcule les amortissements mais il ya une erreure et je n'arrive pas a la corriger
le message d'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 x = duree_amo If Month(Date_acq) > 1 And Month(Date_acq) < 12 Then If Day(Date - acq) < 15 Then For i = 1 To x + 1 Me.txt1(i).Visible = True Me.lbl1(i).Visible = True Me.rem01(i).Visible = True Me.lbl1(i) = Year(Date_acq) + i - 1 i = i + 1 End pam = PU_invs / (x * 12) monthuse = 12 - Month(Date_acq) Me.txt1 = pam * monthuse For i = 2 To x Me.txt1(i) = pam * 12 End If i = x + 1 Then Me.txt1(i) = pam * Month(Date_acq) End If Else For i = 1 To x + 1 Me.txt1(i).Visible = True Me.lbl1(i).Visible = True Me.rem01(i).Visible = True Me.lbl1(i) = Year(Date_acq) + i - 1 i = i + 1 End pam = PU_invs / (x * 12) monthuse = 12 - Month(Date_acq) + 1 Me.txt1 = pam * monthuse For i = 2 To x Me.txt1(i) = pam * 12 End If i = x + 1 Then Me.txt1(i) = pam * (Month(Date_acq) + 1) End If End If End If
aidez moi a corriger mon code please
Code : Sélectionner tout - Visualiser dans une fenêtre à part la variable de control FOR est deja utilisé
Partager