Bonjour,
Dans l'exemple ci-dessous (le fichier est trop grand et je n'ai pas pu le joundre en zip), je reproduit une macro pour chaque ligne. Je pense que je me complique inutilement la vie mais peine à faire autrement...
Valable pour:
NombredeCellulesrouges() et Sub NombredeCellulesbleues()
Sub NombredeCellulesbleues()
' Ligne 25
Dim tot16 As Variant
Range("D25:AH25").Select
For Each Cellule In Selection
If Cellule.Interior.ColorIndex = 5 Then
tot16 = tot16 + Cellule.Count
End If
Next
Range("AJ25") = tot16
' Ligne 26
Dim tot17 As Variant
Range("D26:AH26").Select
For Each Cellule In Selection
If Cellule.Interior.ColorIndex = 5 Then
tot17 = tot17 + Cellule.Count
End If
Next
Range("AJ26") = tot17
' Ligne 27
Dim tot18 As Variant
Range("D27:AH27").Select
For Each Cellule In Selection
If Cellule.Interior.ColorIndex = 5 Then
tot17 = tot17 + Cellule.Count
End If
Next
Range("AJ27") = tot18
ActiveCell.Offset(-11, 31).Range("A1").Select
End Sub
D'avance un immense merci pour votre aide...
Bien à vous
FBF