- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# 198188
¬O¤åªk¤£¬O¤å¤Æ.
·í¤éªº¤é´Á: today()³o¬O¤u§@ªí¨ç¼Æ ,VBA -> Date- Option Explicit
- Sub ex()
- Dim FRng As Range, Wb As Workbook
- Dim A As Range, Rng As Range
- Dim fs As String, xi As Integer
- fs = "C:\Documents and Settings\USER\®à±\b.xlsx"
- Set Wb = Workbooks.Open(fs)
- Set FRng = Wb.Sheets("sheet1").Range("k:k").Find(Date, lookat:=xlWhole, SearchDirection:=xlPrevious) '¦bb.xlsx ªºKÄæ´M§äµ¥·í¤éªº¤é´Áªº¤@¦C
- If Not FRng Is Nothing Then '°²¦p§ä¨ì
- If FRng.Offset(, -3).Value >= 0.95 Then '°²¦pb.xlsx ³o¦CªºHÄ檺Ȥj¹L©Îµ¥©ó0.95
- '*** Workbooks(A)-> A³oÅܼƦr¦ê¨S¦³¨£¨ì ****
- Set Rng = Workbooks(A).Range("a:a").Find(FRng.Offset(, -9), lookat:=xlWhole, SearchDirection:=xlPrevious) ' ¦ba.xlsx ªºAÄæ´M§äb.xlsx ³o¦CªºBÄ檺ȬO§_¦s¦b
- If FRng Is Nothing Then '°²¦p§ä¤£¨ì
- With Workbooks.Open("a.xlsm").Sheets("outstanding payments") ' ¦ba.xlsx ªºAÄæ³Ì«á¤@¦C¥[¤Wb.xlsx ³o¦CªºBÄ檺ȡA¤Î ¦ba.xlsx ªºFÄæ³Ì«á¤@¦C¥[¤Wb.xlsx ³o¦CªºKÄ檺È
- xi = .UsedRange.Cells(.UsedRange.Count).Row
- .UsedRange.Cells(xi, "A") = FRng.Offset(, -9).Value
- .UsedRange.Cells(xi, "F") = FRng.Value
- End With
- End If
- End If
- End If
- End Sub
½Æ»s¥N½X ps: ¦^ÂÐ®É «ö¤U[¥N½X] ±Nµ{¦¡½X¤º®e¶K¤W,´£¥æ,§Y¥i«K©ó¬d¬ÝªÌ,½Æ»sµ{¦¡½X. |
|