|
Sub 提取不重复信息()
Dim dic As Object, dic1 As Object, Dim arr(), i As Integer, iSh As Integer, j As Integer
Set dic = CreateObject("scripting.Dictionary")
Set dic1 = CreateObject("scripting.Dictionary")
For i = 1 To Sheets.Count
dic1(Sheet7.Cells(1, i).Value) = i
Next i
For iSh = 1 To Sheets.Count
With Sheets(iSh)
If dic1.Exists(.Name) = True Then
iRows = .Range("B" & .Rows.Count).End(xlUp).Row
arr = .Range("B1").Resize(iRows).Value
For j = 1 To iRows
If arr(j, 1) <> "学校年班" Then dic(arr(j, 1)) = ""
Next j
Cells(2, dic1(.Name)).Resize(dic.Count, 1).Value = Application.Transpose(dic.Keys)
Erase arr
dic.RemoveAll
End If
End With
Next iSh
End Sub
“六年级”那个sheet名字多了个空格,删掉即可
|
评分
-
查看全部评分
|