MsgBox 128 - Application.Intersect(Selection, Range("A2:H17")).Cells.Count
Private Sub CommandButton1_Click()
For Each Cell In Range("A2:H17")
If Cell.Interior.ColorIndex = xlNone Then
n = n + 1
End If
Next
MsgBox "il y a " & n & " Cellules."
End Sub
Option Explicit
Private Sub CommandButton1_Click()
Dim c As Range, plage As Range, compteur As Integer
Set plage = [A2 : H17]
compteur = 0
For Each c In plage
If c.Interior.Color = 16777215 Then compteur = compteur + 1
Next
MsgBox compteur & " pièce(s) à commander."
End Sub