- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
¦U¦ì°ª¤â¦n¡G
1) §ÚªºVBA¬O©ñ¦bMacro.xlsm¤¤¡A·Q³]©w¤@ÓtÈ,¨Ã¥B©ñ¦b"Macro.xlsm"ªºWorksheets("VBA").Range("B31")¤¤,
¨Ã¥B±NtÈ¥N¤J³oÓ¸ô®|¸Ì Path = "D:\Ī¦Ë¦@¥Î\ÜÀx¦@¥Î\1_²z³f.®w¦s\ºô¸ôq³æ\" & "ºô¸ôq³æ_" & xi & "\" & "ºô¸ôq³æ_" & t & "\"
Àx¦s®æªºÈ¬O¤@Ó¤é´Áªºtext¡A¨Ò¦p¡G20190906¡A¥¦¬O¸ê®Æ§¨©R¦Wªº¤@³¡¥÷¡A§Ú±`±`·|»Ýn§ä´X¤Ñ«eªº¸ê®Æ¡A¥i¥Hª½±µ¦bÀx¦s®æ¤¤×§ï´N¤ñ¸û¤è«K¡A
¦ý¦b°õ¦æµ{¦¡®É,·|¥X²{¹ï¸Ü®Ø§iª¾,¦¹³B»Ýn¤@Óª«¥ó¡A§Ú²q·Q¬O§_ Dim t As String³oӫŧi¿ù»~??ÁÙ¬O¦³¨ä¥¦°ÝÃD?
¥H¤U¬Oµ{¦¡ªº¤@³¡¥÷¡G- Sub EX()
- Dim mFile As String, xmFile As String, rFile As String, ¥ØªºÀÉ As Workbook, ¨Ó·½ÀÉ As Workbook, m¨Ó·½ÀÉ As Workbook, PO¨Ó·½ As Workbook, xPO¨Ó·½ As Workbook, i As String, xi As String, t As String
- Application.Calculation = xlManual '¤â°Êpºâ
- Application.ScreenUpdating = False
- xi = Format(Date, "YYYY.MM") '¤é´Á¦~¤ë³]©w§@¬°¤u§@ªíªºÅܼÆ
- Set t = Workbooks(Workbooks("Macro.xlsm").Worksheets("VBA").Range("B31").Value) 'tÅܼƫü©wÀx¦s®æ¬°ÀɮצW
- '**********************¥ØªºÀɸê®Æ§¨ ²ÎÎëÅ禬(¦³¤½¦¡)
- Path = "D:\0_¦Ûqªí³æ\D²ÎÎëÅ禬\" '¥ØªºÀÉ
- xmFile = Dir(Path & "*²ÎÎëÅ禬*.XLSX") '¨Ó·½ÀɦW
- Do While xmFile <> ""
- Application.DisplayAlerts = False '¤@¯ë´£Äµ¥Ü°T®§Ãö³¬
- Workbooks.Open filename:=Path & xmFile
-
- Set ¥ØªºÀÉ = Workbooks(Dir(Path & "*²ÎÎëÅ禬*.XLSX"))
- '**********************¥ØªºÀÉ ²M°£¤§«e¶K¤Wªº¸ê®Æ....
- ¥ØªºÀÉ.Activate
- Range("q³æ.¤ñµá¦h²ÎÎë").ClearContents
- Range("¤ñµá¦hÅ禬").ClearContents
- xmFile = Dir
- Loop
- '**********************¶}±Òq³æ¸ê®Æ
- Path = "D:\Ī¦Ë¦@¥Î\ÜÀx¦@¥Î\1_²z³f.®w¦s\ºô¸ôq³æ\" & "ºô¸ôq³æ_" & xi & "\" & "ºô¸ôq³æ_" & t & "\" 'q³æ¸ê®Æ§¨
- mFile = Dir(Path & "*²ÎÎë*" & ".XLS") '¨Ó·½ÀÉ
- Do While mFile <> ""
- Application.DisplayAlerts = False '¤@¯ë´£Äµ¥Ü°T®§Ãö³¬
- Workbooks.Open filename:=Path & mFile
½Æ»s¥N½X 2) §Ú¦³ÓbatÀɥΨӦ۰ʳƥ÷ÀÉ®×,§Ú·Q§â¬õ¦â¦r§ï¬°¥i¥H¦Û°Ê±a¥X·í¦~¤Î·í¤ë,·í¦~«×¤Î¤ë¥÷§ïÅÜ®É,´N¤£¥Î¤â°Êקï,½Ð°Ý³oÓÅܼÆn«ç»ò¦bbat¤¤×§ï?
a) 108¦~(¥xÆW¦~«×)¤Î¦è¤¸¦~(2019¦~)ªº¼gªk
b) ¦Û°Ê¨Ì¤ë¥÷ªºÅܼƼgªk¡A¨Ò¡G9¤ë¡B12¤ë.....
@echo off
set hour=%time: =0%
set File=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
echo %File%
xcopy "D:\Ī¦Ë¦@¥Î\ÜÀx¦@¥Î\1_²z³f.®w¦s\¤ñµá¦h\108¦~¤ñµá¦h\Ī¦Ë©Ò¹L¤¹¦¬¦^¼t³æ\*9¤ë.xlsx" "D:\0_¦Ûqªí³æ\Backup\ÜÀx¦@¥Î%File%\¤ñµá¦h\" /D /Y |
|