|
发表于 2013-9-21 12:39
|
显示全部楼层
本楼为最佳答案
附件请测试- Private Sub CommandButton1_Click()
- Dim arr, i&, j&, k&, d As Object, d1 As Object, c
- Set d = CreateObject("scripting.dictionary")
- Set d1 = CreateObject("scripting.dictionary")
- Columns(1).ClearContents
- For k = 6 To 9
- arr = Range(Cells(2, k), Cells(46, k))
- For i = 1 To 45 Step 9
- For j = i To i + 8
- If arr(j, 1) <> "" Then d(arr(j, 1)) = d(arr(j, 1)) + 1
- Next j
- For Each c In d.keys
- If d(c) > 1 Then d1(c) = d1(c) + 1
- Next c
- d.RemoveAll
- Next i
- For Each c In d1.keys
- If d1(c) < 5 Then d1.Remove (c)
- Next c
- If d1.Count > 0 Then Cells([a65536].End(3).Row + 1, 1).Resize(d1.Count) = Application.Transpose(d1.keys)
- d1.RemoveAll
- Next k
- End Sub
复制代码 |
|