Sub CountCells()
Dim Cel As Range, x
Dim Total As Integer
Application.ScreenUpdating = False
For Each Cel In ActiveSheet.Range("d7:J7")
x = GetCellColorForReals(Cel)
If x <> 16777215 Then
Total = Total + Cel.Value
End If
Next Cel
Range("K7") = Total
Application.ScreenUpdating = False
End Sub
Function GetCellColorForReals(R As Range) As Long
GetCellColorForReals = R.DisplayFormat.Interior.Color
End Function
Sub CountCells()
Dim Cel As Range, x
Dim Total As Integer
Application.ScreenUpdating = False
For Each Cel In ActiveSheet.Range("d7:J7")
x = GetCellColorForReals(Cel)
If x <> 16777215 Then
Total = Total + Cel.Value
End If
Next Cel
Range("K7") = Total
Application.ScreenUpdating = False
End Sub
Function GetCellColorForReals(R As Range) As Long
GetCellColorForReals = R.DisplayFormat.Interior.Color
End Function