- ©«¤l
- 38
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 84
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- taichung
- µù¥U®É¶¡
- 2011-7-6
- ³Ì«áµn¿ý
- 2022-3-29
|
§Q¥Î¤U¦Cvba±N¼Æ¤dÓcsvÀÉ(¦P¤@¸ê®Æ§¨¤º)¨Ì¦~«×¤ë¥÷«Ø¥ß¸ê®Æ§¨
·Q½Ð°Ýµ{¦¡½X¤¤#6¦CA = Mid(F, InStr(F, "2004")) ¤¤2004¬°¤â°Ê¿é¤J(µ{¦¡½X½s¿èµøµ¡/°»¿ù/³v¦æ) ,¬O§_¦³¨ä¥L¤è¦¡¥i§ïµ½!
ÁÂÁÂ
Sub Ex()
Dim fs As Object, F As Object, A$, MyPath$
MyPath = ThisWorkbook.Path
Set fs = CreateObject("Scripting.FileSystemObject")
For Each F In fs.GetFolder(MyPath).Files
If InStr(F, ".csv") Then
A = Mid(F, InStr(F, "2004"))
'A = Replace(A, ".csv", "")
' A = Replace(A, "-", "\")
If fs.FolderExists(MyPath & "\" & Mid(A, 1, 4)) = False Then
ChDir MyPath
MkDir MyPath & "\" & Mid(A, 1, 4)
End If
If fs.FolderExists(MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2)) = False Then ChDir MyPath & "\" & Mid(A, 1, 4)
MkDir MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2)
End If
'If fs.FolderExists(MyPath & "\" & A) = False Then
'ChDir MyPath & "\" & Mid(A, 1, 7)
' MkDir MyPath & "\" & A
'End If
fs.moveFile F, MyPath & "\" & Mid(A, 1, 4) & "\" & Mid(A, 5, 2) & "\"
End If
Next
ChDir MyPath
End Sub |
|