|
Sub test()
Dim sh As Worksheet
Dim sht As Worksheet
Set sht = Sheets("结果")
Set d = CreateObject("scripting.dictionary")
With Sheets("结果")
r = .Cells(.Rows.Count, 5).End(3).Row
For i = 4 To r
d(.Cells(i, 5).Value) = i
Next
End With
For Each sh In Sheets
With sh
r = .Cells(.Rows.Count, 1).End(3).Row
For i = 2 To r
If d.exists(.Cells(i, 2).Value) Then
sht.Cells(d(.Cells(i, 2).Value), sh.Name + 5) = .Cells(i, 11).Value
Else
las = d.Count + 1
sht.Cells(las, 4) = .Cells(i, 1)
sht.Cells(las, 5) = .Cells(i, 2)
sht.Cells(las, sh.Name + 5) = .Cells(i, 11)
End If
Next
End With
Next
End Sub
|
评分
-
2
查看全部评分
-
|