Dim b as long Dim c as long Dim d as long Dim e as long For b = 1 to 10 '調べる範囲/行、この場合1~10行 For c = 1 to 26 '調べる範囲/列、この場合A~Z列 d = Cells(b, c).Interior.ColorIndex 'セルの色 If d = 6 Then '探すセルの色によって数字は異なります。「6」は黄色 e = e + 1 End If Next c Next b Range("A1") = e '「A1」セルに結果が表示されます