|
- Private Sub Worksheet_Change(ByVal Target As Range)
- c = Target.Column
- r = Target.Row
- clor = -4142
- clor1 = clor: clor2 = clor: clor3 = clor
- If r < 3 Then Exit Sub
- If c < 9 Or c > 16 Then Exit Sub
- If Cells(r, 9) <= Date - 3 And Len(Cells(r, "K") & Cells(r, "N")) = 0 Then clor1 = vbRed
- If Cells(r, 11) <= Date - 2 And Len(Cells(r, "M")) = 0 Then clor2 = vbYellow
- If Cells(r, 13) <= Date - 4 And (Len(Cells(r, "P")) = 0 Or Len(Cells(r, "O")) = 0) Then clor = vbGreen
- Cells(r, 9).Interior.Color = clor1
- Cells(r, 11).Interior.Color = clor2
- Cells(r, 13).Interior.Color = clor3
- End Sub
复制代码 |
|