|
- Sub test()
- Dim r%, i%
- With Worksheets("sheet1")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- For i = 1 To r
- If .Cells(i, 6).Interior.ColorIndex <> 6 Then
- If .Cells(i, 2).Value = Application.Sum(.Cells(i, 3).Resize(1, 3)) Then
- .Cells(i, 6) = "是"
- Else
- .Cells(i, 6) = "否"
- End If
- End If
- Next
- c = .Cells(1, .Columns.Count).End(xlToLeft).Column
- For j = 9 To c
- If .Cells(1, j).Interior.ColorIndex <> 6 Then
- If .Cells(5, j).Value = Application.Sum(.Cells(1, j).Resize(4, 1)) Then
- .Cells(6, j) = "是"
- Else
- .Cells(6, j) = "否"
- End If
- End If
- Next
- End With
- End Sub
复制代码 |
|