- ©«¤l
- 145
- ¥DÃD
- 42
- ºëµØ
- 0
- ¿n¤À
- 193
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-11-25
- ³Ì«áµn¿ý
- 2024-10-10
|
·PÁÂAndy2483¦b¤@¯ë°Ïªº¨ó§U¡A¤w¦¨¥\¸Ñ¨Mµ¹¤j®a°Ñ¦Ò~
±N»¡©ú¼ÐÃDקï
¤½¦¡Â²¤Æ 20231002-4.rar (114.31 KB)
Sub TEST()
Dim Brr, Crr, Z, i&, j%, V%, V7%
Set Z = CreateObject("Scripting.Dictionary")
With Sheets("»¡©ú"): Brr = Range(.Cells(.UsedRange.Rows.Count, "A"), .[IV1].End(xlToLeft)): End With
For j = 1 To UBound(Brr, 2)
If Left(Trim(Brr(1, j)), 6) <> "" Then Z(Left(Trim(Brr(1, j)), 6)) = j
Next
Crr = Range([WIP!O1], [WIP!A65536].End(3))
For i = 2 To UBound(Crr)
V = Val(Crr(i, 15)): V7 = Val(Crr(i, 7)): Crr(i - 1, 1) = ""
If Z.Exists(Left(Trim(Crr(i, 1)), 6)) <> Empty Then
Crr(i - 1, 1) = Round(Brr(V7 + 2, Z(Left(Trim(Crr(i, 1)), 6))) * V, 0)
ElseIf Right(Left(Crr(i, 1), 7), 1) = "W" Then
Crr(i - 1, 1) = Round(Brr(V7 + 2, Z("W")) * V, 0)
Else
Crr(i - 1, 1) = Round(Brr(V7 + 2, Z(Left(Crr(i, 2), 1))) * V, 0)
End If
Next
[WIP!D2].Resize(UBound(Crr) - 1, 1) = Crr
Set Z = Nothing: Erase Brr, Crr
End Sub |
|