Bonjour

J’ai créé un objet (21 propriétés public, 5 fonctions . . . . ) que j’instancie 19 fois dans mon application, ensuite je fais différents calcule et regroupement dans la feuille, le tout fonctionne parfaitement bien,

Mais pour refaire une vérification, je recopie le contenu de mes objets dans une autre feuille sans trop de chichi ni de formatage pratiquement dans l’ordre d’écriture de mes propriétés,
J’aimerai le faire par une boucle :

For nombre d’objet . . . . . . . . . . . . .
For nombre de propriétés . . . . . . . . . . . . .

En fait savoir combien de fois j’ai instancié un objet, combien il a de propriété et écrire leurs contenu dans la feuille X

Voici le code de l’objet en question

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 
Option Explicit
Option Base 1
 
Public Event Completed()
Private Chaine As String
Private tab_tri(19) As Long
Private Ar() As String
 
    Property Let La_Chaine(La_Chaine As String) ' Propriété en lecture
    Chaine = La_Chaine
     Ar = Split(Chaine, Chr(59))                                                          ' Separateur = Chr(59)
                    tab_tri(1) = tab_tri(1) + 1                                           ' APP_CTI_TGT
                If Ar(13) <> 0 Then tab_tri(2) = tab_tri(2) + 1                           ' APP_NB_REP
                If Ar(14) <> 0 Then tab_tri(3) = tab_tri(3) + 1                           ' APP_NB_DIS
                If Ar(15) <> 0 Then tab_tri(4) = tab_tri(4) + 1                           ' APP_NB_ABD
                If Ar(18) <> 0 Then tab_tri(5) = tab_tri(5) + 1                           ' APP_NB_ABC
                If Ar(21) <> 0 Then tab_tri(6) = tab_tri(6) + 1                           ' APP_NB_A3M
                If Ar(22) <> "" Then                                                      ' APP_TT_ABD
                                tab_tri(7) = tab_tri(7) + Ar(22)
                                If tab_tri(8) < Ar(22) Then tab_tri(8) = Ar(22)
                                End If
                 If Ar(23) <> 0 Then tab_tri(9) = tab_tri(9) + 1                          ' APP_NB_RSA
                 If Ar(25) <> 0 Then tab_tri(10) = tab_tri(10) + 1                        ' APP_NB_R20
                 If Ar(26) <> 0 Then tab_tri(11) = tab_tri(11) + 1                        ' APP_NB_R60
                 If Ar(27) <> "" Then                                                     ' APP_TT_AAR
                                 tab_tri(12) = tab_tri(12) + Ar(27)
                                 If tab_tri(13) < Ar(27) Then tab_tri(13) = Ar(27)
                                 End If
                If Ar(28) <> 0 Then tab_tri(14) = tab_tri(14) + 1                        ' APP_NB_TRF
                If Ar(31) <> 0 Then tab_tri(15) = tab_tri(15) + 1                        ' APP_NB_RON
                If Ar(36) <> "" Then tab_tri(16) = tab_tri(16) + Ar(36)                  ' APP_TT_COM / APP_NB_REP
                If Ar(34) <> "" Then tab_tri(17) = tab_tri(17) + Ar(34)                  ' APP_TT_SON
                If Ar(35) <> "" Then tab_tri(18) = tab_tri(18) + Ar(35)                  ' APP_TT_CON
                If Ar(37) <> "" Then tab_tri(19) = tab_tri(19) + Ar(37)                  ' APP_TT_MEG / APP_NB_REP
 
    End Property
 
Property Get App_cti_tgt() As String
    ' Propriété en lecture
    App_cti_tgt = tab_tri(1)
End Property
Property Get app_nb_rep() As String
 app_nb_rep = tab_tri(2)
End Property
'********* pour doublon ************
Property Get app_nb_dis() As String
 app_nb_dis = tab_tri(3)
End Property
 
Property Get app_nb_abd() As String
 app_nb_abd = tab_tri(4)
End Property
Property Get app_nb_abc() As String
 app_nb_abc = tab_tri(5)
End Property
'********* pour doublon ************
Property Get app_nb_a3m() As String
 app_nb_a3m = tab_tri(6)
End Property
Property Get app_tt_abd() As String
 app_tt_abd = tab_tri(7)
End Property
'********* pour doublon ************
Property Get max_app_tt_abd() As String
 max_app_tt_abd = tab_tri(8)
End Property
'********* pour doublon ************
Property Get app_nb_rsa() As String
 app_nb_rsa = tab_tri(9)
End Property
'********* pour doublon ************
Property Get app_nb_r20() As String
 app_nb_r20 = tab_tri(10)
End Property
'********* pour doublon ************
Property Get app_nb_r60() As String
 app_nb_r60 = tab_tri(11)
End Property
Property Get app_tt_aar() As String
 app_tt_aar = tab_tri(12)
End Property
'********* pour doublon sens conversion ************
Property Get max_app_tt_aat_decimal() As Variant
max_app_tt_aat_decimal = tab_tri(13)
End Property
'********* pour doublon ************
Property Get app_nb_trf() As String
 app_nb_trf = tab_tri(14)
End Property
'********* pour doublon ************
Property Get app_nb_ron() As String
app_nb_ron = tab_tri(15)
End Property
'********* pour doublon ************
Property Get app_tt_com() As String
app_tt_com = tab_tri(16)
End Property
'********* pour doublon ************
Property Get app_tt_son() As String
app_tt_son = tab_tri(17)
End Property
'********* pour doublon ************
Property Get app_tt_con() As String
app_tt_con = tab_tri(18)
End Property
'********* pour doublon ************
Property Get app_tt_meg() As String
app_tt_meg = tab_tri(19)
End Property
 
Private Sub Class_Initialize()
Erase tab_tri
End Sub
Public Function Prise_appels() As Variant
    If tab_tri(1) <> 0 Then Prise_appels = tab_tri(2) / (tab_tri(1) - tab_tri(5))     ' APP_NB_REP / (APP_CTI_TGT >0 - APP_NB_ABC)
End Function
 
Public Function Avant_decrochage() As Variant
    If tab_tri(12) <> 0 Then Avant_decrochage = SecondeEnHeure(Int(tab_tri(12) / tab_tri(2))) _
    Else Avant_decrochage = 0                                                         ' APP_TT_AAR / APP_NB_REP
End Function
 
Public Function Avant_abandon() As Variant
    If tab_tri(7) <> 0 Then Avant_abandon = SecondeEnHeure(Int(tab_tri(7) / tab_tri(4))) _
    Else Avant_abandon = "00:00:00"
End Function
 
Property Get max_app_tt_aat() As Variant
max_app_tt_aat = SecondeEnHeure(Int(tab_tri(13))) ' MAX APP_TT_AAR
End Property
 
Private Sub IsCompleted()
    MsgBox "Evenement IsComleted"
        RaiseEvent Completed
End Sub
Et une partie du code(bourrin) qui me permets d’éditer leurs contenu :

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
40
41
42
43
44
 
   '************ Pour alimenter la feuille Doublon en cas de controle ***********************
  Worksheets("Doublon").Range("B3:T21").ClearContents
    Feuil7.Cells(3, 2) = car_reseaux.App_cti_tgt
    Feuil7.Cells(3, 3) = car_reseaux.app_nb_rep
    Feuil7.Cells(3, 4) = car_reseaux.app_nb_dis
    Feuil7.Cells(3, 5) = car_reseaux.app_nb_abd
    Feuil7.Cells(3, 6) = car_reseaux.app_nb_abc
    Feuil7.Cells(3, 7) = car_reseaux.app_nb_a3m
    Feuil7.Cells(3, 8) = car_reseaux.app_tt_abd
    Feuil7.Cells(3, 9) = car_reseaux.max_app_tt_abd
    Feuil7.Cells(3, 10) = car_reseaux.app_nb_rsa
    Feuil7.Cells(3, 11) = car_reseaux.app_nb_r20
    Feuil7.Cells(3, 12) = car_reseaux.app_nb_r60
    Feuil7.Cells(3, 13) = car_reseaux.app_tt_aar
    Feuil7.Cells(3, 14) = car_reseaux.max_app_tt_aat_decimal
    Feuil7.Cells(3, 15) = car_reseaux.app_nb_trf
    Feuil7.Cells(3, 16) = car_reseaux.app_nb_ron
    Feuil7.Cells(3, 17) = car_reseaux.app_tt_com
    Feuil7.Cells(3, 18) = car_reseaux.app_tt_son
    Feuil7.Cells(3, 19) = car_reseaux.app_tt_con
    Feuil7.Cells(3, 20) = car_reseaux.app_tt_meg
 
    Feuil7.Cells(4, 2) = car_region.App_cti_tgt
    Feuil7.Cells(4, 3) = car_region.app_nb_rep
    Feuil7.Cells(4, 4) = car_region.app_nb_dis
    Feuil7.Cells(4, 5) = car_region.app_nb_abd
    Feuil7.Cells(4, 6) = car_region.app_nb_abc
    Feuil7.Cells(4, 7) = car_region.app_nb_a3m
    Feuil7.Cells(4, 8) = car_region.app_tt_abd
    Feuil7.Cells(4, 9) = car_region.max_app_tt_abd
    Feuil7.Cells(4, 10) = car_region.app_nb_rsa
    Feuil7.Cells(4, 11) = car_region.app_nb_r20
    Feuil7.Cells(4, 12) = car_region.app_nb_r60
    Feuil7.Cells(4, 13) = car_region.app_tt_aar
    Feuil7.Cells(4, 14) = car_region.max_app_tt_aat_decimal
    Feuil7.Cells(4, 15) = car_region.app_nb_trf
    Feuil7.Cells(4, 16) = car_region.app_nb_ron
    Feuil7.Cells(4, 17) = car_region.app_tt_com
    Feuil7.Cells(4, 18) = car_region.app_tt_son
    Feuil7.Cells(4, 19) = car_region.app_tt_con
    Feuil7.Cells(4, 20) = car_region.app_tt_meg
 
   '************      Ainsi de suite 19 fois
C’est cette partit que j’aimerai simplifier
Merci de vos conseils,