方法如下:
1.在E列中统计每行填敏举充红色的单元格个数
2.Alt+F11,输入代码如下:
3.得到结备皮果如下仿拿差:
Sub s()
Set rg = [i:m]
x = rg.Column
y = x + rg.Columns.Count - 1
c = 7
cc = 45
n = ActiveSheet.UsedRange.Item(ActiveSheet.UsedRange.Count).Row + 1
For i = 1 To cc
If n <= i Then Exit For
t = 0
For j = x To y
做历 If Cells(n - i, j).Interior.ColorIndex <> xlNone Then t = t + 1
告郑 Next
袜胡颂 Cells(n - i, c) = t
If t = 0 Then Cells(n - i, c).Interior.ColorIndex = 3
Next
End Sub