|
参与一下。。。
- Sub byWanao()
- Dim i%, j%, arr, WB As Workbook, Dic As Object, Path$
- Set Dic = CreateObject("Scripting.Dictionary")
- Path = ThisWorkbook.Path & "\总表.xlsx"
- Set WB = GetObject(Path)
- With WB.Sheets(1)
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- WB.Close 0
- For i = 2 To UBound(arr)
- For j = 2 To UBound(arr, 2)
- s = arr(i, 1) & "|" & arr(1, j)
- Dic(s) = arr(i, j)
- Next
- Next
- For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row
- For j = 2 To 5
- s = arr(i, 1) & "|" & arr(1, j)
- If Dic.exists(s) Then
- Cells(i, j) = Dic(s)
- End If
- Next
- Next
- Set Dic = Nothing
- Set WB = Nothing
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|