|
Sub 填充颜色()
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With ActiveSheet
r = .Cells(Rows.Count, 4).End(xlUp).Row
.Range("a2:g" & r).Interior.ColorIndex = 0
.Range("d2:g" & r).Font.Strikethrough = False
For i = 2 To r
If Trim(.Cells(i, 7)) <> "" Then
If IsDate(.Cells(i, 7)) Then
.Cells(i, 4).Resize(1, 4).Interior.ColorIndex = 15
.Cells(i, 7).Font.Strikethrough = True
End If
End If
If Trim(.Cells(i, 1)) <> "" Then
zd = Trim(.Cells(i, 1)) & "|" & Trim(.Cells(i, 3))
d(zd) = d(zd) + 1
End If
Next i
For Each k In d.keys
For i = 2 To r
If Trim(.Cells(i, 1)) <> "" Then
zd = Trim(.Cells(i, 1)) & "|" & Trim(.Cells(i, 3))
If zd = k Then
sl = d(zd)
If sl > 1 Then
.Cells(i, 1).Resize(1, 3).Interior.ColorIndex = 45
End If
End If
End If
Next i
Next k
End With
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|