- ©«¤l
- 406
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 453
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWS 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2015-2-7
- ³Ì«áµn¿ý
- 2021-7-31
|
¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-4-5 22:01 ½s¿è
¦^´_ 1# eric7765
·Ç¤jªºµ{¦¡¦n¹³§â¨S¦³«½Æªº³¡¤À¡A¤]¤@°_¦C¥X¨Ó¤F
¤À¨É¤@¤U§Úªº¼gªk
1.¥¿±`¼gªk~2ÓFor°j°é
Sub L2()
Dim Arr, Brr, K, D As Object
Set D = CreateObject("Scripting.Dictionary")
[E1].CurrentRegion.ClearContents
Arr = Range([B1], [A65536].End(xlUp))
For R = 2 To UBound(Arr)
½s$ = Arr(R, 1)
D(½s) = D(½s) & "," & Arr(R, 2)
Next
'===========
Brr = Array("«½ÆÈ", "A", "B", "C", "D", "E", "F", "G")
[E1].Resize(1, UBound(Brr) + 1) = Brr
ReDim Brr(1 To D.Count, 1 To UBound(Brr))
For Each Key In D.keys
K = Split(D(Key), ",")
If UBound(K) > 1 Then
Ro% = Ro% + 1
Brr(Ro, 1) = Key
For C = 1 To UBound(K) 'ASC("A")=65
Brr(Ro, Asc(UCase(K(C))) - 63) = K(C)
Next
End If
Next
[E2].Resize(UBound(Brr), UBound(Brr, 2)) = Brr
End Sub
2.¤ñ¸ûÃøÀ´ªº¼gªk~1ÓFor°j°é
(¹ê´ú°õ¦æ³t«×¨S¦³¤ñ¸û§Ö..........)
Sub L1()
Dim Arr, Brr, D As Object
Set D = CreateObject("Scripting.Dictionary")
[E1].CurrentRegion.ClearContents
Arr = Range([B1], [A65536].End(xlUp))
Brr = Array("«½ÆÈ", "A", "B", "C", "D", "E", "F", "G")
[E1].Resize(1, UBound(Brr) + 1) = Brr
ReDim Brr(1 To UBound(Arr), 1 To UBound(Brr))
For R = 2 To UBound(Arr)
½s$ = Arr(R, 1): ²Õ$ = D(½s)
If ²Õ = "" Then
D(½s) = Arr(R, 2)
ElseIf Val(²Õ) = 0 Then 'ASC("A")=65
Ro% = Ro% + 1: Brr(Ro, 1) = ½s: D(½s) = Ro
Brr(Ro, Asc(UCase(²Õ)) - 63) = ²Õ
Brr(Ro, Asc(UCase(Arr(R, 2))) - 63) = Arr(R, 2)
ElseIf Val(²Õ) >= 1 Then
Brr(Val(²Õ), Asc(UCase(Arr(R, 2))) - 63) = Arr(R, 2)
End If
Next
[E2].Resize(UBound(Brr), UBound(Brr, 2)) = Brr
End Sub |
|