|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub test()
Set DIC = CreateObject("SCRIPTING.DICTIONARY")
[A2].CurrentRegion.Offset(1, 2).ClearContents
Workbooks.Open ThisWorkbook.Path & "\数据源.xls"
RNG = Sheets("SHEET1").UsedRange
ActiveWorkbook.Close False
For R = 7 To UBound(RNG)
For C = 5 To UBound(RNG, 2)
Y = RNG(R, 3) & RNG(6, C)
DIC(Y) = RNG(R, C)
Next C
Next R
RNG1 = ActiveSheet.[A2].CurrentRegion
For R = 2 To UBound(RNG1)
For C = 3 To UBound(RNG1, 2)
Y = RNG1(R, 1) & RNG1(1, C)
RNG1(R, C) = DIC(Y)
Next C
Next R
ActiveSheet.[A2].CurrentRegion = RNG1
End Sub
|
|