|
- Sub gj23w98()
- Set d = CreateObject("scripting.dictionary")
- With Sheet2
- arr = .[a1].CurrentRegion
- m = UBound(arr): n = UBound(arr, 2)
- For i = 2 To m
- For j = 2 To n
- s = arr(i, 1) & arr(1, j)
- d(s) = arr(i, j)
- Next
- Next
- End With
- With Sheet3
- .[a1].CurrentRegion.Offset(1).ClearContents
- Range("a2:a" & Rows.Count).Copy .[a2]
- brr = .[a1].CurrentRegion
- For i = 2 To UBound(brr)
- For j = 2 To UBound(brr, 2)
- s = brr(i, 1) & brr(1, j)
- If d.exists(s) Then
- brr(i, j) = d(s)
- Else
- brr(i, j) = 0
- End If
- Next
- Next
- .[a1].CurrentRegion = brr
- End With
- End Sub
复制代码 |
|