- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß1#½d¨Ò¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
°õ¦æ«e:
°õ¦æµ²ªG:
Option Explicit
Sub TEST_1()
Dim Brr, Crr, Y, R&, i&, j%, N&, T1$, T2$, V1&, V2&
Set Y = CreateObject("Scripting.Dictionary")
[E2:F2000].ClearContents
Brr = Range([B7], Cells(Rows.Count, 1).End(3))
ReDim Crr(1 To UBound(Brr), 1 To 2)
For i = 1 To UBound(Brr)
T1 = Brr(i, 1): T2 = Brr(i, 2)
If T1 = "" Or Val(T2) = 0 Then GoTo i01
V1 = Val(T2): V2 = StrReverse(Split(StrReverse(T2), "-")(0))
For j = V1 To V2
If Y(T1) = "" Then N = N + 1: Y(T1) = N: Crr(N, 1) = T1
If Y(T1 & j) = "" Then
R = Y(T1): Y(T1 & j) = 1: Crr(R, 2) = Crr(R, 2) + 1
End If
Next
i01: Next
If N > 0 Then [E2].Resize(N, 2) = Crr
Set Y = Nothing: Erase Brr, Crr
End Sub |
|