|
Sub 标记()
Application.ScreenUpdating = False
Dim ar As Variant
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With ActiveSheet
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 2 Then MsgBox "不成立订单导入表 (二次筛选)为空!": End
.Range("a1:q" & r).Interior.ColorIndex = 0
ar = .Range("a1:q" & r)
For i = 2 To UBound(ar)
If Trim(ar(i, 2)) <> "" And Trim(ar(i, 14)) <> "" Then
zd = Trim(ar(i, 2)) & "|" & Trim(ar(i, 14))
d(zd) = d(zd) + 1
.Cells(i, 17) = d(zd)
.Cells(i, 2).Interior.ColorIndex = d(zd) + 2
.Cells(i, 14).Interior.ColorIndex = d(zd) + 2
.Cells(i, 17).Interior.ColorIndex = d(zd) + 2
End If
Next i
End With
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub |
|