- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
¥æ´Áªí:
WIPªí°õ¦æ«e:
WIPªí°õ¦æµ²ªG:
Option Explicit
Sub TEST() '¡ô
Dim Arr, Brr, Crr, V$, Y, R&, i&, S&, T1$, T3$
Set Y = CreateObject("Scripting.Dictionary")
Brr = Range([¥æ´Á!C2], [¥æ´Á!A65536].End(xlUp))
For i = 1 To UBound(Brr): Y(Brr(i, 1)) = Y(Brr(i, 1)) & "/" & i: Next
Crr = Range([WIP!C2], [WIP!A65536].End(xlUp))
ReDim Arr(1 To UBound(Crr), 1 To 1)
For i = 1 To UBound(Crr)
T1 = Crr(i, 1): T3 = Crr(i, 3)
If Y(T1) = "" Then Arr(i, 1) = "µLq³æ": GoTo i01
i00: S = Y(T1 & "|¾l¶q")
If S <= 0 Then
V = Mid(Y(T1), InStr(Y(T1), "/") + 1) & "/": R = Val(V)
If R = 0 Then Arr(i, 1) = "µLÄò³æ": GoTo i01
Y(T1) = V: Y(T1 & "|¾l¶q") = Brr(R, 3) + S
If Y(T1 & "|¾l¶q") <= 0 Then GoTo i00
Y(T1 & "|¥æ´Á") = Brr(R, 2)
End If
Arr(i, 1) = Y(T1 & "|¥æ´Á")
Y(T1 & "|¾l¶q") = Y(T1 & "|¾l¶q") - Crr(i, 3)
i01: Next
[WIP!D2].Resize(UBound(Arr)) = Arr
Set Y = Nothing: Erase Arr, Brr, Crr
End Sub |
|