ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] §ó·s¤é´Á+°²¤é¤£§ó·s

[µo°Ý] §ó·s¤é´Á+°²¤é¤£§ó·s

³Ìªñ¼g¤F¤@¬q¦Û°Ê§ó·sªº»yªk
¦ý¬O¦³¹J¨ì¨â­Ó°ÝÃD
1.
¥~³æ¦ìªºExcelÀɦW·|¨Ì·Ó¤é´Á¥h­×§ï¡A­n¦p¦ó¼gVBAÅý§ì¨úªº«ü©w¸ô®|¦WºÙ¸ò¤é´Á¤@¼Ë
Workbooks.Open ("\\SMK\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\2023.04.13 ¨C¤é¼Ò¨ã²§°Ê.xlsx")
Workbooks.Open ("\\SMK\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\¼Ò¨ã²§°Ê-¤»ºÖ(«æ¥ó1.9±M¥Î)\LF¨C¤é¼Ò¨ã²§°Ê.xlsx")
Workbooks("LF¨C¤é¼Ò¨ã²§°Ê.xlsx").Worksheets("LF").Range("A:AG").ClearContents
Workbooks("2023.04.13 ¨C¤é¼Ò¨ã²§°Ê.xlsx").Worksheets("LF").Columns("A:AG").Cells.Copy
Workbooks("LF¨C¤é¼Ò¨ã²§°Ê.xlsx").Worksheets("LF").Range("A:AG").PasteSpecial Paste:=xlPasteValues
¤»´T²§°Êªí.PNG

2.
¤»¤éµL¤H¤W¯Z©Ò¥H¤£·|§ó·s¡A­n¦p¦ó¼gVBAÅý¨t²Î¹J¨ì°²¤é¤£°õ¦æ§ó·s
Private Sub Workbook_Open()
    Application.OnTime TimeValue("06:00:00"), "full_calc"
End Sub

¦^´_ 24# Andy2483


«D±`·PÁÂAndy2483¤j¤jºëÅP¸Ñ»¡
¤p§Ì¨ü¯q¨}¦h

TOP

¦^´_ 23# cowww


    ÁÂÁ«e½ú¦^´_,¤@°_¾Ç²ß,ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½Æ²ß¤è®×,¤è®×ªº¤ß±oµù¸Ñ¦p¤U,½Ð«e½ú°Ñ¦Ò,½Ð¦U¦ì«e½ú«ü±Ð

Option Explicit
Sub TEST()
Dim T$, B$, i%
'¡ô«Å§iÅܼÆ(T,B)¬O¦r¦êÅܼÆ,i¬Oµu¾ã¼Æ
T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\¼Ò¨ã²§°Ê-¤»ºÖ(«æ¥ó1.9±M¥Î)\"
'¡ô¥OT³o¦r¦êÅܼƬO "¸ê®Æ§¨¦ì§}\"
For i = 0 To 10
'¡ô³]¶¶°j°é!i±q0 ¨ì10
   B = Format(Date - i, "yyyy.mm.dd")
   '¡ô¥OB³o¦r¦êÅܼƬO ¤µ¤Ñ¤é´Á´î±¼iÅܼƫ᪺¤é´ÁÂà´«¦¨¦r¦ê,
   '¦r¦ê:4½X¦~2½X¤ë2½X¤é¤¤¶¡¥["."²Å¸¹

   If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") <> Empty Then GoTo i01
   '¡ô¥HTÅܼƳs±µ BÅܼÆ,¦A³s±µ " ¨C¤é¼Ò¨ã²§°Ê.xlsx"ªº·s¦r¦ê,
   '¦pªG³o·s¦r¦ê¥h¬d¦³³o­ÓÀÉ®×?? (PS:¤£¬OªÅªº´N¬O¦³ªº·N«ä)
   '¦pªG¦³³oÀÉ®×´N¸õ¨ì i01¼Ð¥Ü¦ì¸mÄ~Äò°õ¦æ

Next
MsgBox "§ä¤£¨ì " & Date & " ~ " & Date - 10 & " ÀÉ®×": Exit Sub
'¡ô·í¤W­z°j°é¶]§¹¤FÁ٧䤣¨ì·Q­nªº¦ì§}»PÀɦWÀÉ®×!
'´N¸õ¥X´£¥Üµ¡,Åã¥Ü11¤Ñ°Ï¶¡¤é´Á¨S¦³²Å¦XªºÀÉ®×
'³Ì«áµ²§ôµ{¦¡°õ¦æ

i01: Workbooks.Open Filename:=T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx", ReadOnly:=True
'¡ô°ßŪ¶}±ÒÀÉ®×
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 22# Andy2483

§ÚÀ´¤F
«D±`·PÁÂAndy2483¤j¤jªº¸Ñµª

TOP

¦^´_ 21# cowww


    Empty(ªÅªº)
<>Empty(¤£¬OªÅªº)´N¬O¦³
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 20# Andy2483

¦¨¥\¤F
«D±`·PÁÂAndy2483¤j¤j¸Ñµª

¦³­Ó¦a¤è§Ú¬Ý¤£À´
If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") <> Empty Then GoTo i01

<>¬°¦ó¬O¥Î¤£µ¥©óªº²Å¸¹

TOP

¦^´_ 19# cowww


    ÁÂÁ«e½ú¦A¦^´_,¤@°_¾Ç²ß
¥H¤U¬O¾Ç²ß¤è®×,½Ð«e½ú°Ñ¦Ò

Option Explicit
Sub TEST()
Dim T$, B$, i%
T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\¼Ò¨ã²§°Ê-¤»ºÖ(«æ¥ó1.9±M¥Î)\"
For i = 0 To 10
   B = Format(Date - i, "yyyy.mm.dd")
   If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") <> Empty Then GoTo i01
Next
MsgBox "§ä¤£¨ì " & Date & " ~ " & Date - 10 & " ÀÉ®×": Exit Sub
i01: Workbooks.Open Filename:=T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx", ReadOnly:=True
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 18# Andy2483


«D±`·PÁÂAndy2483¤j¤jªº¸Ñµª
¦ý¬O§ÚÁÙ¬O¤£ª¾¹D¨º¬q»yªk­n©ñ­þ­Ó¦ì¸m
§Ú¥t¥~°µ¤@­Ó«ö¶s¨Ó´ú¸Õ¬O§_¯à°÷¶}±Ò
Sub «ö¶s2_Click()
T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\¼Ò¨ã²§°Ê-¤»ºÖ(«æ¥ó1.9±M¥Î)\"

A = Format(Date, "W")
B = Format(Date, "yyyy.mm.dd")
If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then
   For i = 0 To 10
   B = Format(Date - i, "yyyy.mm.dd")
   If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then MsgBox "§ä¤£¨ì " & B & " ÀÉ®×": Exit Sub
   Next
End If
Workbooks.Open filename:=T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx", ReadOnly:=True
End Sub
¥u§ì²Ä¤@¤Ñ.PNG

TOP

¦^´_ 17# cowww


For i = 0 To 10
   B = Format(Date -i, "yyyy.mm.dd")
   Msgbox B
Next
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 14# Andy2483


©êºp
Andy2483¤j¤j
§Ú¬O·s¤â(¬°¤F¤u§@³Q­¢¾Ç¨ç¼Æ©MVBA)¡A¤£·|¼g°j°é

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD