Bonjour tout le monde,

Je souhaiterais que le code ci dessous s'exécute pour chaque ligne de mon tableau.
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
Sub calcul_tableau_Facturation()
 
Dim i As Integer
Dim b_existe As Boolean
 
'On créer une boucle pour trouver la feuille qui nous convien ici la feuille de facturation
For i = 1 To Sheets.Count
   If InStr(1, Sheets(i).Name, "Facturation") > 0 Then
       b_existe = True
     Sheets(i).Activate
    End If
 
Next
 
 
'on cherche la ligne Shared Infrastructure
    Set x = Cells.Find("Shared Infrastructure", , xlValues, xlPart, , , False)
    If Not x Is Nothing Then x.Offset(0, 12).Select 'On sélectionne le montant Technology Ownership pour 1 une société (ici la première ligne)
 
    variable1 = ActiveCell.Value
    MsgBox variable1
 
'on cherche la ligne Shared Infrastructure
Set x = Cells.Find("Shared Infrastructure", , xlValues, xlPart, , , False)
If Not x Is Nothing Then x.Offset(0, 19).Select 'On sélectionne le montant Technology Ownership pour 1 une société (ici la première ligne)
 
variable2 = ActiveCell.Value
MsgBox variable2
'On compare les deux valeurs pour l'ajustements des couts
If variable2 <> variable1 Then
    total_ajustement_technology_ownership = variable1 - variable2
    MsgBox total_ajustement_technology_ownership
 
Else
    MsgBox "Le compte est bon"
End If
 
i = 13
j = 20
 
Do
    'on cherche la ligne Shared Infrastructure
    Set x = Cells.Find("Shared Infrastructure", , xlValues, xlPart, , , False)
    If Not x Is Nothing Then x.Offset(0, i).Select 'On sélectionne le montant Technology Ownership pour 1 une société (ici la première ligne)
 
    variable1 = ActiveCell.Value
    MsgBox variable1
 
   'on cherche la ligne Shared Infrastructure
    Set x = Cells.Find("Shared Infrastructure", , xlValues, xlPart, , , False)
    If Not x Is Nothing Then x.Offset(0, j).Select 'On sélectionne le montant Technology Ownership pour 1 une société (ici la première ligne)
 
    variable2 = ActiveCell.Value
    MsgBox variable2
 
    'On compare les deux valeurs pour l'ajustements des couts
    If variable2 <> variable1 Then
        total_ajustement = variable1 - variable2
        MsgBox total_ajustement
 
    Else
        MsgBox "Le compte est bon"
    End If
    i = i + 1
    j = j + 1
 
Loop While i <> 16
 
End Sub

Merci d'avance!