Sub recup_sommes()
'remettre à 0 le compteur :
For y = 10 To 29
Sheets("Outils").Cells(y, 1).Clear
Sheets("Outils").Cells(y, 3).Clear
Next y
For Each feuille In Sheets
If feuille.Name <> "Outils" And feuille.Name <> "Paramètres" Then
For i = 4 To 23
nom_actu = feuille.Cells(i, 1).Value
If nom_actu <> "" Then
nom_trouve = False
'chercher valeur dans l'onglet outils
For y = 10 To 29
If nom_actu = Sheets("Outils").Cells(y, 1).Value Then
'nom trouvé : ajouter
nom_trouve = True
Sheets("Outils").Cells(y, 3).Value = Sheets("Outils").Cells(y, 3).Value + feuille.Cells(i, 2).Value
End If
Next y
If nom_trouve = False Then
'si aucune correspondance : ajouter
y = 10
nom_ajoute = False
While nom_ajoute = False And y <= 23 'vérifier de ne pas dépasser la ligne 23
If Sheets("Outils").Cells(y, 1).Value <> "" Then
y = y + 1 'ligne suivante
Else
'ajouter ici
Sheets("Outils").Cells(y, 1).Value = feuille.Cells(i, 1).Value
Sheets("Outils").Cells(y, 3).Value = feuille.Cells(i, 2).Value
nom_ajoute = True 'sortie de la boucle
End If
Wend
End If
End If
Next i
End If
Next
End Sub