|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub e111112()
Dim arr, arr1, arr2(), arr3
Dim d As Object
arr = Sheet1.Range("A2:J9")
arr1 = Sheet2.Range("A2:J6")
Set d = CreateObject("scripting.dictionary")
For x = 1 To UBound(arr)
d(arr(x, 1)) = arr(x, 2) & "/" & arr(x, 3) & "/" & arr(x, 4) & "/" & arr(x, 5) & "/" & arr(x, 6) & "/" & arr(x, 7) & "/" & arr(x, 8) & "/" & arr(x, 9) & "/" & arr(x, 10)
Next
ReDim arr2(1 To UBound(arr1, 1), 1 To UBound(arr1, 2) - 1)
For Y = 1 To UBound(arr1)
arr3 = Split(d(arr1(Y, 1)), "/")
arr2(Y, 1) = arr3(0)
arr2(Y, 2) = arr3(1)
arr2(Y, 3) = arr3(2)
arr2(Y, 4) = arr3(3)
arr2(Y, 5) = arr3(4)
arr2(Y, 6) = arr3(5)
arr2(Y, 7) = arr3(6)
arr2(Y, 8) = arr3(7)
arr2(Y, 9) = arr3(8)
Next Y
Sheet2.Range("B2").Resize(UBound(arr1, 1), UBound(arr1, 2) - 1) = arr2
End Sub |
评分
-
1
查看全部评分
-
|