ªð¦^¦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

¦^´_ 1# cowww


    ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú,ÁÂÁ«e½úµoªí¦¹¥DÃD
«á¾Ç¾Ç²ßªº«Øij¦p¤U:

Sub Format_Date() '¨C¶gªº²Ä¤@¤Ñ¬O¬P´Á¤é
MsgBox "-¤»ºÖ\" & Format(Date, "yyyy.mm.dd") & " ¨C¤é¼Ò¨ã²§°Ê.xlsx"
MsgBox Format("2023/4/13", "W")
End Sub
'¨ä¥L«D¤».¤é°ê©w°²¤é.¸É°².¸É¯Z¶·­n¹ï·Óªí,½Ð°Ñ¦Ò
http://forum.twbts.com/thread-23838-1-1.html
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 2# Andy2483

«D±`·PÁÂAndy2483¤j¤jªº¸Ñµª
²Ä¤@­Ó°ÝÃD¸Ñ¨M¤F

²Ä¤G­Ó¸Ñ¨M¿ìªk¡A¤p§Ì¯uªº¬Ý¤£À´
¥i¥H½ÐAndy2483¤j¤j»¡©ú¶Ü??
¨ä¹ê§Úªº»Ý¨D«Ü²³æ¡A¹J¨ì¤»¤é®É´NÅýVBA¥h§ì¬P´Á¤­ªº¤é´Á´N¦n
¸É¯Zor³s°²ªº°ÝÃD¥i¥H¥ýÁ׶}¨SÃö«Y

TOP

¦^´_ 3# cowww

ÁÂÁ«e½ú¦A¦^´_
"¹J¨ì¤»¤é®É´NÅýVBA¥h§ì¬P´Á¤­ªº¤é´Á´N¦n"
«á¾Ç¹ï¦¹±¡¹Òªº¸Ñ¨M¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò

Sub ¤»¤é§ì¤­() '¨C¶gªº²Ä¤@¤Ñ¬O¬P´Á¤é
Dim A%, B$
A = Format(Date, "W")
B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A > 1, Date), "yyyy.mm.dd")
MsgBox B
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 4# Andy2483

¦]¬°¦Û°Ê°õ¦æªº®É¶¡¬O«ü©w¦b¦­¤W06:00¶}©l¡A¤]´N¬O»¡§ìªº¥~³æ¦ìÀɮצWºÙªº¤é´Á·|¬O¬Q¤Ñªº(¹L¤F00:00)
Private Sub Workbook_Open()
    Application.OnTime TimeValue("06:00:00"), "full_calc"
End Sub

½Ð°ÝAndy2483¤j¤j¡A¥i¤£¥i¥H§âWorkbooks.Open......"B"§ï¦¨"B-1"´N¥i¥H¦b¦­¤W06:00¦Û°Ê°õ¦æ®É§ì¨ì¬Q¤Ñ¤é´Áªº¥~³æ¦ì¸ê®Æ??
A = Format(Date, "W")
B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A > 1, Date), "yyyy.mm.dd")
Workbooks.Open ("\\SMK\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\" & B - 1 & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")

TOP

¦^´_ 5# cowww


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

TOP

¦^´_ 6# Andy2483

«D±`·PÁÂAndy2483¤j¤jªº«ü¾É

½Ð°Ý¬õ¦â¦rÅ騺¬q­þ¸Ì¼g¿ù¤F??
2023.04.14 ¨C¤é¼Ò¨ã²§°Ê->¬O¦]¬°¤é´Á©M¤å¦r¤§¶¡¦³¤@­ÓªÅ®æ³y¦¨ªº¶Ü??
'¶}±Ò¤»´T²§°Êªí
A = Format(Date, "W")
B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A = 2, Date - 3, A > 2, Date - 1), "yyyy.mm.dd")
MsgBox B
Workbooks.Open ("\\SMK\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\" & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")


MsgBox B->Åã¥Üªº¤é´Á¨S¦³°ÝÃD
°T®§¤è¶ô.PNG

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-4-14 08:32 ½s¿è

¦^´_ 7# cowww

¥X²{¤°»ò¿ù»~°T®§¶Ü?
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 8# Andy2483


«D±`©êºp
­è­èÀˬd¤F©Ò¦³·|¨Ï¥Î¨ìªºexcelµo²{
¤»´T²§°Êªíªº¤é´Á¦b­â±á03:21´N§ó·s¤é´Á
¥H«e³£¬O¦­¤W08:00¤§«á¤~§ó§ï¡A©Ò¥H¦Û°Ê°õ¦æªº®É¶¡§Ú¤~·|³]©w06:00
¤»ºÖ.PNG

­è­è§â»yªk§ï¦¨A>1,date´N¨S°ÝÃD¤F

«D±`·PÁÂAndy2483¤j¤jªº«ü¾É

TOP

¦^´_ 7# cowww

½Ð°Ý³o¬q§PÂ_¦¡­þ¸Ì¼g¿ù¤F
§Ú§Æ±æ¨t²Î¥ý¥h§ä·í¤Ñ¤é´Áªº²§°Êªí¡A¥i¬O¥¦³£¬O¥h§ä¬Q¤Ñªº¤é´Á
¦pªG"¦³"->°õ¦æIf
¦pªG"¨S¦³"->¦AElse
A = Format(Date, "W")
If B = Format(Date, "yyyy.mm.dd") Then
Workbooks.Open ("\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\" & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")

Else: B = Format(Switch(A = 7, Date - 1, A = 1, Date - 2, A = 2, Date - 3, A > 2, Date - 1), "yyyy.mm.dd")
Workbooks.Open ("\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\D.¥Í²£¬ÛÃö\2.¨C¤é¼Ò¨ã²§°Ê\¼Ò¨ã²§°Ê-¤»ºÖ\" & B & " ¨C¤é¼Ò¨ã²§°Ê.xlsx")

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD