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

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

¦^´_ 10# cowww


    If B = Format(Date, "yyyy.mm.dd") Then
«e¤è¨S¦³µ¹BÅܼƭÈ,©Ò¥H
B ¥²©w¤£µ¥©ó Format(Date, "yyyy.mm.dd")
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 10# cowww


Sub §P©w¸ô®|¤UÀɮ׬O¤£¬O¦s¦b()
If Dir("D:\2023.04.14 TEST.xls") <> Empty Then
   MsgBox "¦³³oÀÉ®×"
End If
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 10# cowww


Sub ¥ý§P©w¬O¤£¬O¦³¤µ¤Ñªº()
Dim T$, A%, B$
T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\"
A = Format(Date, "W")
B = Format(Date, "yyyy.mm.dd")
If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then
   B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A = 2, Date - 3, A > 2, Date - 1), "yyyy.mm.dd")
   If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then MsgBox "§ä¤£¨ì " & B & " ÀÉ®×": Exit Sub
End If
Workbooks.Open (T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 10# cowww


    ¥Î13#¼Ó¬dÀɮ׬O§_¦s¦bªº¤è¦¡¦A¦h¤@­Ó¦^°é ±q¤µ¤Ñ¶}©l§P©w¡A§ä¤£¨ì´N­Ë°h¤é´ÁÄ~Äò§ä¡A§ä¨ì´N¸õ¥X°j°é¡A¶}±ÒÀÉ®×
¦p¦¹¤è¦¡¥i¥H§ä¨ì³Ì·sªº¡A¤£¥²¦Ò¼{¬P´Á´X¡H
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 14# Andy2483

«D±`·PÁÂAndy2483¤j¤jªº¸Ñµª
¬Ý¬Ý©ú¤Ñ¬O§_·|¦¨¥\

©ú©ú¦³¼gÃö³¬´£¥Üªº»yªk¡A¬°¦ó¶}±Ò¨ä¥L³æ¦ìªº²§°ÊªíÁÙ¬O­n¿é¤J±K½X©O??
'Ãö³¬´£¥Ü
Application.DisplayAlerts = False

T = "\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\"
A = Format(Date, "W")
B = Format(Date, "yyyy.mm.dd")
If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then
   B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A = 2, Date - 3, A > 2, Date - 1), "yyyy.mm.dd")
   If Dir(T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx") = Empty Then MsgBox "§ä¤£¨ì " & B & " ÀÉ®×": Exit Sub
End If
Workbooks.Open (T & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")
±K½X.PNG

TOP

¦^´_ 15# cowww


    Set xB = Workbooks.Open(ThisWorkbook.Path & "\" & BKN & ".xls", ReadOnly:=True) '°ßŪ¶}±ÒÀÉ®×
http://forum.twbts.com/viewthrea ... 2Bonly%3A%3D%2BTrue
¥Î¦æ°Ê¸Ë¸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

¦^´_ 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

¦^´_ 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

¦^´_ 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

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD