- ©«¤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
|
¦^´_ 2# wufonna
'**Dir ·|¶Ç¦^²Ä¤@Ó»P_¸ô®|¦WºÙ_¬Û²ÅªºÀɮצWºÙ¡C Yn¨ú±o¥ô¦ó»P_¸ô®|¦WºÙ_¬Û²Åªº¨ä¥LÀɮצWºÙ¡A½Ð¦A¦¸©I¥s¤£§t¤Þ¼Æªº Dir
§AªþÀɪºµ{¦¡½X¦³ª¼ÂI If Dir(strPath, vbDirectory) = "" Then MkDir strPath
'**¤W¦¡µ{¦¡½X¦A¦¸¨Ï¥Î Dir(strPath, vbDirectory) ¾ÉP myname = Dir ¶Ç¦^ªÅ¦Û¦r¦ê
§A³oµ{¦¡½X¥i¥Hªº
¤]¥i¥ÎFileSystemObject ª«¥ó ¸Õ¸Õ- Option Explicit
- Sub Ex()
- Dim myPath As String, myFile As String, myname As String, n As Variant, strPath As String
- Dim AR(), Folder As String
- myPath = ThisWorkbook.Path & "\" 'myPath = ThisWorkbook.Path Àɮ׸ô®|
- myFile = "*.JPG"
- myname = Dir(myPath & myFile, vbDirectory) ' 'Dir ´M§äÀɮ׸ô®|\ *.JPG"ªºÀÉ®×
- Do While myname <> ""
- strPath = myPath & Replace(myname, ".jpg", "")
- With New FileSystemObject '¤Þ¥Î¶µ¥Ø Microsoft Scripting Runtime
- On Error Resume Next 'ªí¥Ü·í¤@Ó°õ¦æ¶¥¬q¿ù»~²£¥Í®É¡Aµ{¦¡±±¨î¥ß¨è¨ìµo¥Í¿ù»~³¯z¦¡±µ¤U¥hªº³¯z¦¡¡A¦ÓÄ~Äò°õ¦æ¤U¥h
- If .GetFolder(strPath) Is Nothing Then MkDir strPath '**¥[¤J¹Ï¤ù¦WºÙªº¸ê®Æ§¨
- On Error GoTo 0 '°±¤î²{¦bµ{§ÇùØ¥ô¦ó¤w±Ò°Êªº¿ù»~³B²zµ{¦¡
- End With
- myname = Dir
- Loop
- End Sub
½Æ»s¥N½X |
|