- ©«¤l
- 36
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 44
- ÂI¦W
- 0
- §@·~¨t²Î
- win 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-1-8
- ³Ì«áµn¿ý
- 2020-10-29
|
¦^´_ 3# ¤pµØ
¬õ¦â³o¬q¤@ª½¶]°j°é ¸õ¤£¥X¨Ó ¸ê®Æ¶q¦³¤W¤dµ§
Set x = Workbooks("CL Diff.xlsm").Sheets("Upload-1")
Set y = Workbooks("CL Diff.xlsm").Sheets("MB58")
Set Z = Workbooks("CL Diff.xlsm").Sheets("Diff")
i = Z.Cells(1, 1).End(xlDown).Row
b = y.Cells(1, 1).End(xlDown).Row
c = x.Range("L1")
For k = 2 To i
f = Z.Cells(k, 8)
If Z.Cells(k, 18) <> 0 Then
If Z.Cells(k, 26) = "" Then
For j = 2 To b
q = y.Cells(j, 7) - Z.Cells(k, 18)
If y.Cells(j, 8) = f And y.Cells(j, 2) = Z.Cells(k, 2) And q > 0 Then
x.Cells(c + 2, 1) = Z.Cells(k, 2)
x.Cells(c + 2, 2) = Z.Cells(k, 3)
x.Cells(c + 2, 3) = Z.Cells(k, 4)
x.Cells(c + 2, 4) = Z.Cells(k, 5)
x.Cells(c + 2, 5) = Z.Cells(k, 6)
x.Cells(c + 2, 6) = Z.Cells(k, 7)
x.Cells(c + 2, 7) = Z.Cells(k, 8)
x.Cells(c + 2, 8) = Z.Cells(k, 9)
x.Cells(c + 2, 9) = Z.Cells(k, 18)
Z.Cells(k, 26) = "OK"
ElseIf q < 0 Then
x.Cells(c + 2, 1) = Z.Cells(k, 2)
x.Cells(c + 2, 2) = Z.Cells(k, 3)
x.Cells(c + 2, 3) = Z.Cells(k, 4)
x.Cells(c + 2, 4) = Z.Cells(k, 5)
x.Cells(c + 2, 5) = Z.Cells(k, 6)
x.Cells(c + 2, 6) = Z.Cells(k, 7)
x.Cells(c + 2, 7) = Z.Cells(k, 8)
x.Cells(c + 2, 8) = Z.Cells(k, 9)
x.Cells(c + 2, 9) = y.Cells(j, 7)
Z.Cells(k, 26) = "¼Æ¶q®t" & q
End If
Next j
End If
End If
Z.Cells(k, 26) = "µL¶q®t"
Next k
MsgBox ("¸ê®Æ¤w¾ã²z§¹²¦")
End Sub |
|