- ©«¤l
- 122
- ¥DÃD
- 26
- ºëµØ
- 0
- ¿n¤À
- 148
- ÂI¦W
- 0
- §@·~¨t²Î
- windos10
- ³nÅ骩¥»
- office2016
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2021-7-8
- ³Ì«áµn¿ý
- 2023-8-28
|
½Ð°Ý½×¾Âªº¤j¤jÌ
§Ú¦³¼g¤@¬qÃö³¬´£¥Üªº»yªk¡A¦ý¬O¨C¦¸¶}±Ò¬YÓÀÉ®×®ÉÁÙ¬O·|¥X²{"§ó·s³sµ²"ªº´£¥Ü
¦ý¬O¨ºÓÀɮ׬O¨ä¥¦³æ¦ìªº¡A©Ò¥H§ÚµLªk¹ï¨ºÓÀÉ®×°µ¥ô¦óªº³]©w
½Ð°Ý©³¤Uªº»yªkn¦p¦óקï¤~¥i¥HÃö³¬©Ò¦³ªº¨t²Î´£¥Ü
'VBA ¥N½X¹B¦æ®É¸T¥Î«Ì¹õ§ó·s
Application.ScreenUpdating = False
'Ãö³¬¨t²Î´£¥Ü
Application.DisplayAlerts = False
'¶}±Ò¤»´T²§°Êªí
'«Å§iÅܼÆ(T,B)¬O¦r¦êÅܼÆ,i¬Oµu¾ã¼Æ
On Error Resume Next '¹J¨ì¿ù»~Ä~Äò°õ¦æ¤U¤@¦æ«ü¥O
Dim T As String
Dim i As Integer
'¥OT³o¦r¦êÅܼƬO "¸ê®Æ§¨¦ì§}\"
T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\"
'³]¶¶°j°éi±q0 ¨ì15
For i = 0 To 15
'¥OB³o¦r¦êÅܼƬO ¤µ¤Ñ¤é´Á´î±¼iÅܼƫ᪺¤é´ÁÂà´«¦¨¦r¦ê
'¦r¦ê:4½X¦~2½X¤ë2½X¤é¤¤¶¡¥["."²Å¸¹
Dim B As String
B = Format(Date - i, "yyyy.mm.dd")
' «Ø¥ßT & B ¨C¤é¼Ò¨ã²§°Ê.xlsx¦ì§}
' ÀˬdT & B ¨C¤é¼Ò¨ã²§°Ê.xlsx¬O§_¦s¦b
' °ßŪ¶}±ÒT & B ¨C¤é¼Ò¨ã²§°Ê.xlsx¤å¥ó
' §ä¨ì¤å¥ó«á¸õ¥X
Dim filePath1 As String
filePath1 = T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx"
If Dir(filePath1) <> "" Then
Workbooks.Open fileName:=filePath1, ReadOnly:=True
Exit For
End If
' «Ø¥ßT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¦ì§}
' ÀˬdT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¬O§_¦s¦b
' °ßŪ¶}±ÒT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¤å¥ó
' §ä¨ì¤å¥ó«á¸õ¥X
Dim filePath2 As String
filePath2 = T & B & "¨C¤é¼Ò¨ã²§°Ê.xlsx"
If Dir(filePath2) <> "" Then '
Workbooks.Open fileName:=filePath2, ReadOnly:=True
Exit For
End If
' «Ø¥ßT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¦ì§}
' ÀˬdT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¬O§_¦s¦b
' °ßŪ¶}±ÒT & B¨C¤é¼Ò¨ã²§°Ê.xlsx¤å¥ó
' §ä¨ì¤å¥ó«á¸õ¥X
Dim filePath3 As String
filePath3 = T & B & "¨C¤é¼Ò¨ã²§°Ê_New.xlsx"
If Dir(filePath3) <> "" Then '
Workbooks.Open fileName:=filePath3, ReadOnly:=True
Exit For
End If
Next i
On Error GoTo 0 'µ²§ô¿ù»~Ä~Äò°õ¦æ
'·í¤Wz°j°é¶]§¹¤FÁ٧䤣¨ì·Qnªº¦ì§}»PÀɦWÀÉ®×!
'´N¸õ¥X´£¥Üµ¡,Åã¥Ü16¤Ñ°Ï¶¡¤é´Á¨S¦³²Å¦XªºÀÉ®×
'³Ì«áµ²§ôµ{¦¡°õ¦æ
If i = 16 Then
MsgBox "§ä¤£¨ì " & Date & " ~ " & Date - 15 & " ÀÉ®×"
End If
'²M°£¿z¿ï
ActiveSheet.AutoFilterMode = False
|
|