- ©«¤l
- 438
- ¥DÃD
- 67
- ºëµØ
- 0
- ¿n¤À
- 531
- ÂI¦W
- 30
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-10-30
- ³Ì«áµn¿ý
- 2024-11-19
|
- Sub Detail()
- Dim FRng As Range
- Dim A As Range, Rng As Range
- Dim i As Integer
- fs = "W:\Payment Daily Report\HK ETA update.xlsx"
- Set Wb = Workbooks.Open(fs)
- With ThisWorkbook.Worksheets("State")
- For Each A In .Range(.[A2], .Range("A1").End(xlDown))
- Set FRng = Wb.Sheets("HK HAIPONG").Range("A:A").Find(A, LookAt:=xlWhole, SearchDirection:=xlPrevious)
- If Not FRng Is Nothing Then
- A.Offset(, 2) = FRng.Offset(, 11).Value
- If Rng Is Nothing Then Set Rng = A.Offset(, 2) Else Set Rng = Union(Rng, A.Offset(, 2))
- End If
-
- Set FRng = Nothing
- Next
- End With
- Wb.Close 0
-
- fs = "W:\Payment Daily Report\Mainland ETA Update.xlsx"
- Set Wb = Workbooks.Open(fs)
- With ThisWorkbook.Worksheets("State")
- For Each A In .Range(.[A2], .Range("A1").End(xlDown))
- Set FRng = Wb.Sheets("MAILAND ETA").Range("A:A").Find(A, LookAt:=xlWhole, SearchDirection:=xlPrevious)
- If Not FRng Is Nothing Then
- A.Offset(, 3) = FRng.Offset(, 9).Value
- If Rng Is Nothing Then Set Rng = A.Offset(, 3) Else Set Rng = Union(Rng, A.Offset(, 3))
- End If
-
- Set FRng = Nothing
- Next
- End With
- Wb.Close 0
-
- fs = "W:\Payment Daily Report\Outstanding Payments.xlsm"
- Set Wb = Workbooks.Open(fs)
- With ThisWorkbook.Worksheets("State")
- For Each A In .Range(.[A2], .Range("A1").End(xlDown))
- Set FRng = Wb.Sheets("outstanding payments").Range("A:A").Find(A, LookAt:=xlWhole, SearchDirection:=xlPrevious)
- If Not FRng Is Nothing Then
- A.Offset(, 6) = FRng.Offset(, 4).Value
- If Rng Is Nothing Then Set Rng = A.Offset(, 6) Else Set Rng = Union(Rng, A.Offset(, 6))
- End If
-
- Set FRng = Nothing
- Next
- End With
- Wb.Close 0
-
- End Sub
½Æ»s¥N½X ¦^´_ 24# c_c_lai
§Ú¥H«e³oÓµ{¦¡³£µL°ÝÃD¡A¦ý¤µ¤é¤£ª¾¹D¬°¤°»ò¥X²{°ÝÃD¡A¦bIf Not FRng Is Nothing Then³o¥y¤W¥X²{¡G code execution has been interrupted
½Ð°Ý¬O¤°»ò·N«ä¡H |
|