- ©«¤l
- 262
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 280
- ÂI¦W
- 17
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- HK
- µù¥U®É¶¡
- 2015-8-11
- ³Ì«áµn¿ý
- 2024-11-19
|
°²³]§Aªº¸ê®Æ "ID" ´N¦b [A1] ¶}©l, ¥N½X¦p¤U:- Sub zz()
- Dim d As Object, dd As Object, k, t, n&, m&, HL$, b()
- Set d = CreateObject("scripting.dictionary")
- Set dd = CreateObject("scripting.dictionary")
- a = [a1].CurrentRegion
- For i = 2 To UBound(a)
- k = a(i, 1)
- d(k) = d(k) + 1
- dd(k) = dd(k) & "|" & i
- Next
- n = Application.Max(d.items)
- HL = a(1, 1) & "|" & a(1, 2)
- For j = 3 To UBound(a, 2)
- For jj = 1 To n
- HL = HL & "|" & a(1, j) & jj
- Next
- Next
- t = Split(HL, "|")
- ReDim b(1 To d.Count + 1, 1 To UBound(t) + 1)
- Workbooks.Add 1
- [a1].Resize(1, UBound(b, 2)) = t
- k = dd.keys: n = 0
- For i = 0 To UBound(k)
- t = Split(dd(k(i)), "|")
- n = n + 1
- b(n, 1) = a(t(1), 1)
- b(n, 2) = a(t(1), 2)
- m = 2
- For j = 3 To UBound(a, 2)
- For jj = 1 To UBound(t)
- m = m + 1
- b(n, m) = a(t(jj), j)
- Next
- Next
- Next
- [a2].Resize(n, UBound(b, 2)) = b
- End Sub
½Æ»s¥N½X |
|