|
本帖最后由 lsc900707 于 2018-10-8 08:13 编辑
用字典匹配的问题。
- Sub gj23w98()
- Set d = CreateObject("scripting.dictionary")
- arr = Sheet2.[a1].CurrentRegion
- For i = 2 To UBound(arr)
- For j = 3 To UBound(arr, 2)
- s = arr(i, 1) & arr(i, 2) & arr(1, j)
- If Len(arr(i, j)) Then d(s) = arr(i, j)
- Next
- Next
- brr = [a1].CurrentRegion
- For i = 2 To UBound(brr)
- For j = 3 To UBound(brr, 2)
- s = brr(i, 1) & brr(i, 2) & brr(1, j)
- If d.exists(s) Then brr(i, j) = d(s)
- Next
- Next
- [a1].CurrentRegion = brr
- MsgBox "成绩已更正!"
- Set d = Nothing
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|