- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# mark126
¸Õ¸Õ¬Ý- Sub Ex() '½Æ»sªºÀÉ®×,¥¨¶°ªº¬¡¶Ã¯,¤÷¼h¸ê®Æ§¨¬Û¦Pªºµ{¦¡½X
- Dim fs As Object, F As Object, A$, MyPath$
- MyPath = ThisWorkbook.Path '³o¬¡¶Ã¯ªº¸ê®Æ§¨¦WºÙ
- Set fs = CreateObject("Scripting.FileSystemObject") '´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨úªºª«¥ó
- For Each F In fs.GetFolder(MyPath).Files
- '**** asv ³o°ÆÀɦW¨S¨£¹L **********
- If InStr(F, "_") And InStr(F, ".asv") Then 'ÀɮצWºÙ¤¤´M§ä "_" °ÆÀɦW ".asv"
- A = Mid(F, InStr(F, "_") + 1) '¨úªº"_"¤§«áªº¦r¦ê
- A = Replace(A, ".xls", "") '§R±¼°ÆÀɦW
- A = Replace(A, "-", "\") '´À´«"-"¬°"\"
- If fs.FolderExists(MyPath & "\" & Mid(A, 1, 4)) = False Then '§ä¤£¨ì[¦~«×]ªº¸ê®Æ§¨
- ChDir MyPath '§ïÅܥثeªº¥Ø¿ý©ÎÀɮק¨ ¨ì MyPath
- '¦p½Æ»sªºÀɮץتº¦a»P,¥¨¶°ªº¬¡¶Ã¯,¤÷¼h¸ê®Æ§¨¤£¬Û¦P,¥i¥t³]¤@Åܼƨú¥N MyPath
- MkDir Mid(A, 1, 4) '«Ø¥ß¤@Ó·sªº¥Ø¿ý©ÎÀɮק¨¡C
- End If
- If fs.FolderExists(MyPath & "\" & Mid(A, 1, 7)) = False Then '§ä¤£¨ì[¦~«×¤ë¥÷]ªº¸ê®Æ§¨
- ChDir MyPath & "\" & Mid(A, 1, 4)
- MkDir MyPath & "\" & Mid(A, 1, 7)
- End If
- If fs.FolderExists(MyPath & "\" & A) = False Then '§ä¤£ [¦~«×¤ë¥÷¤é´Á]ªº¸ê®Æ§¨
- ChDir MyPath & "\" & Mid(A, 1, 7)
- MkDir MyPath & "\" & A
- End If
- fs.CopyFile F, MyPath & "\" & A & "\" '½Æ»sÀÉ®×¨ì «ü©wªº¸ô®|
- End If
- Next
- ChDir MyPath '¦^¨ìì¥Ø¿ý
- End Sub
½Æ»s¥N½X |
|