|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Main()
- Dim oSht As Worksheet
- Dim I&, J&, Ar, Br
- Dim Dic, Key$, K&
- Dim Col()
- ReDim Br(1 To 10000, 1 To 13)
- Col = Array(5, 6, 11)
- Set Dic = CreateObject("Scripting.Dictionary")
- For Each oSht In Worksheets
- If oSht.Name <> "检查表" Then
- Ar = oSht.Range("a1").CurrentRegion
- oSht.Cells.Interior.Color = xlNone
- For I = 3 To UBound(Ar)
- Key = Ar(I, Col(0)) & Ar(I, Col(1)) & Ar(I, Col(2))
- If Dic(Key) = "" Then
- Dic(Key) = 1
- Else
- K = K + 1
- With oSht
- .Range(.Cells(I, 1), .Cells(I, 13)).Interior.Color = vbRed
- End With
- For J = 1 To UBound(Ar, 2)
- Br(K, J) = Ar(I, J)
- Next J
- End If
- Next I
- Erase Ar
- End If
- Next
- Sheets("检查").Range("a3").Resize(K, 13) = Br
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|