ä¾åæ°æ®æºï¼
ç¨åºä»£ç ï¼
è¿è¡ç»æï¼
æ¯ä¸æ¯å¾å®ç¾ï¼ç¨åºææ¬ï¼
Option Explicit
Sub 转æ¢()
Dim a1, a2(1 To 1000, 1 To 100), i, j, x, y, m, n
Set x = CreateObject("Scripting.Dictionary")
Set y = CreateObject("Scripting.Dictionary")
a1 = Range("a1").CurrentRegion
For i = 1 To UBound(a1)
If a1(i, 1) = "ä»·æ ¼" Then
If Not y.Exists(a1(i, 2)) Then
a2(1, y.Count + 2) = a1(i, 2)
y.Add a1(i, 2), y.Count + 2
End If
n = y(a1(i, 2))
Else
If Not x.Exists(a1(i, 1)) Then
a2(x.Count + 2, 1) = a1(i, 1)
x.Add a1(i, 1), x.Count + 2
End If
m = x(a1(i, 1))
a2(m, n) = a1(i, 2)
End If
Next i
Range("d1").Resize(x.Count + 1, y.Count + 1) = a2
End Sub
追é®ä¸æ è¶çå¢ï¼
追çå ä¼°ç®ä¸ä¸æ°æ®ï¼ä¿®æ¹ä¸ä¸ç¨åºä¸ç1000ã100大ä¸äº
能否发一下VBA的代码,谢谢
本回答被网友采纳