- ©«¤l
- 163
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 246
- ÂI¦W
- 27
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- ie
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-7-8
- ³Ì«áµn¿ý
- 2024-9-14
|
¥»©«³Ì«á¥Ñ mdr0465 ©ó 2024-3-5 23:26 ½s¿è
¦^´_ 3# Andy2483
Andy ¾Ç¥S,§A¦n
¤S¬O§Ú³o¤@¦W·MÄøªº¾Ç§Ì
Sub TEST()
Dim Arr, Brr, Crr, V, Z, Q, i&, j%, R&, c%, Y&, X%, T$, T1$, T2$, T3$
Dim xR As Range, Ra As Range, Sh As Worksheet, xBook As Workbook
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([Data!E2], [Data!A65536].End(3))
For i = 1 To UBound(Brr)
T = Trim(Brr(i, 1)) & "/" & Val(Brr(i, 2)) & "/" & Val(Brr(i, 3))
If Z.EXISTS(T) Then
MsgBox T & "«½Æ": Exit Sub
Else
Z(T) = Val(Brr(i, 5))
Z(T & "/n") = 1
End If
Next
Arr = Range([Invoice!H12], [Invoice!C65536].End(3))
ReDim Crr(1 To UBound(Arr), 1 To 6)
For i = 1 To UBound(Arr)
If Trim(Arr(i, 1)) = "" Then GoTo i01
T = Trim(Arr(i, 1)) & "/" & Val(Arr(i, 2)) & "/" & Val(Arr(i, 3))
Z(T & "/n") = Z(T & "/n") + 1
If Z(T & "/n") > 2 Then MsgBox T & "«½Æ": Exit Sub Else V = Z(T)
If V = "" Then GoTo i01
Crr(i, 1) = V
Crr(i, 2) = V - Val(Arr(i, 4))
Crr(i, 3) = Application.Round(Val(Arr(i, 2)) * Val(Arr(i, 3)) / 10 ^ 6, 3)
Crr(i, 4) = Crr(i, 3) - Val(Arr(i, 5))
Crr(i, 5) = Application.Round(Crr(i, 3) * Val(Arr(i, 4)), 3)
Crr(i, 6) = Crr(i, 5) - Val(Arr(i, 6))
i01: Next
[Invoice!J12].Resize(UBound(Crr), 6) = Crr << ¦bºô¤W§ä¨ì¦n¦h³oÃþ«¬ªº½s½X, resize(ubound(Crr).6) §Ú³£²z¸Ñ, ¦ý=Crr§Ú©l²×³£¤£©ú¥Õ³oÓì²z, ³Â·Ð§A¥i¤£¥i¥H«üÂI¾Ç§Ì°g¬z, «ç¼ËÀ³¥Î³oºØ¤èªkªº½s½X©O , ÁÂÁÂ
End Sub |
|