- ©«¤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-7-31 02:50 ½s¿è
¦^´_ 1# ABK
§Aªº¹Ï¤ù[H3]Äæ¦ìªºÈ¦n¹³¿ù¤F~~~
®É¶¡±ß¤F©Ò¥H¨S¼gµù¸Ñ¡A¦³°ÝÃD¦Aµo°Ý
µ{¦¡¦p¤U¡A¸Õ¸Õ¬Ý!
Sub test0731()
Dim Arr, S$, T$, R%, Ro%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Arr = Range([A2], [C3].End(4))
With Sheets.Add
.[A1].Resize(UBound(Arr), 3) = Arr
With .[A1].CurrentRegion
.Sort key1:=.Item(1), order1:=xlAscending, _
key2:=.Item(3), order1:=xlAscending
End With
Arr = .[A1].CurrentRegion: .Delete
End With
[F1].CurrentRegion.Offset(1).ClearContents
ReDim Brr(1 To 1000, 1 To 7)
For R = 1 To UBound(Arr)
If InStr(S, "-" & Arr(R, 1) & "-") = 0 Then
Ro = Ro + 1: T = Arr(R, 1): K = 1
Brr(Ro, 1) = Arr(R, 1)
Brr(Ro, 2) = Arr(R, 2)
Brr(Ro, 5) = Arr(R, 3)
S = S & "," & "-" & Arr(R, 1) & "-"
Else
If Arr(R, 1) = T And K < 3 Then
Brr(Ro, 2 + K) = Arr(R, 2)
Brr(Ro, 5 + K) = Arr(R, 3)
K = K + 1
End If
End If
Next R
[F2].Resize(UBound(Brr), 7) = Brr
End Sub |
|