ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð¤j¤j¦pªG¥Ø¿ý¦s¦b²¤¹L¤£­n½Æ»s¡A¦p¦ó§ï¡AÁÂÁÂ

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

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD