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

[µo°Ý] ·j´M½Æ»s°ÝÃD

[µo°Ý] ·j´M½Æ»s°ÝÃD

¥»©«³Ì«á¥Ñ imzues ©ó 2012-3-16 17:23 ½s¿è

½Ð°Ý¦U¦ì¤j¤jVBA¦³¿ìªk¥i¥H
±NEXCLE¸ÌªºÀɦW¡A·j´M¸ô®|¤¤ªº¸ê®Æ§¨¡A½Æ»s¨ì¬Y­Ó¸ê®Æ§¨¶Ü¡H

¦^´_ 1# imzues
ª©¤W¦³Ãþ¦ü¤å³¹..
³o¬O°ò¦¥Îªk. ¥i¥Hµø±¡ªp¥[¥HÀ³¥Î

    Sub ox()
    Set fd = CreateObject("scripting.filesystemobject")
        fd.copyfolder "d:\9996\995", "d:\9996\996\993\"  '995 ¸ê®Æ§¨ ¾ã¥÷½Æ»s¨ì 993 ¤º
End Sub

TOP

¦^´_ 2# mark15jill

§Úªþ¥ó¤W¨Ó¡A·Q½Ð¤j¤jÀ°¦£¸Ñ¨M
·PÁÂ
text.zip (4.22 KB)

TOP

¦^´_ 3# imzues
  1. Sub ex()
  2. Set fdo = CreateObject("Scripting.FileSystemObject")
  3. fd = "D:\A\"
  4. fs = Dir(fd & "*")
  5. Do Until fs = ""
  6.    If IsNumeric(Application.Match(Split(fs, "-")(0), Columns("A"), 0)) Then
  7.    fdo.copyfile fd & fs, "D:\B\" & fs
  8.    End If
  9.    fs = Dir
  10. Loop
  11. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-19 10:36 ½s¿è

¦^´_ 3# imzues


    §Úªº¼gªk¸òH¤j¤j¤£¤Ó¤@¼Ë
    ¬O¤ñ¸ûÄÝ©ó¯B°Êªº¸ô®|~ ´£¨Ñµ¹§A°Ñ¦Ò~
  1. Private Sub CommandButton1_Click()
  2. '===== ¿ï¾Ü¦sªº¸ô®|=======
  3. With Application.FileDialog(msoFileDialogFolderPicker)
  4.     If .Show = 0 Then Exit Sub
  5.     patch = .SelectedItems(1)
  6.     Application.DefaultFilePath = patch
  7. End With
  8. '=====================
  9. '=====ÀÉ®×­n¤ñ¹ïªº¸ô®|======
  10. With Application.FileDialog(msoFileDialogFolderPicker)
  11.     If .Show = 0 Then Exit Sub
  12.     fd = .SelectedItems(1)
  13.     If .ButtonName = "½T©w" Then
  14.     fs = Dir(fd & "\*.xls")
  15.         Do Until fs = ""
  16.            sa = Left(fs, 9)
  17.            Set fk = Sheet1.Range("A:A").Find(sa)
  18.            If Not fk Is Nothing Then
  19.             With Workbooks.Open(fs)
  20.             .SaveAs Application.DefaultFilePath & "\" & fs
  21.             .Close
  22.             End With
  23.            End If
  24.            fs = Dir
  25.         Loop
  26.     End If
  27. End With
  28. '=============================
  29. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 3# imzues
¹w³]  D:\A¸ê®Æ§¨   D:\B¸ê®Æ§¨
°Ê§@¡G ±qEXCEL §PÂ_ÀɦW ¦A±qA ½Æ»s¨ì B  (·h²¾·|¦³°ÝÃD)

Sub test()

    Dim objFs As Object
    Set objFs = CreateObject("Scripting.FileSystemObject")
For xt = 1 To 20
    If Range("a" & xt).Value <> "" Then
            For xuo = 1 To 20
                If Dir("d:\¤ñ¹ï\A¸ê®Æ§¨\" & Left(Range("a" & xt).Value, 9)) & "-051115619000-OEM-T 190.xls" <> "" Then
                        objFs.copyfile "d:\¤ñ¹ï\A¸ê®Æ§¨\" & Left(Range("a" & xt).Value, 9) & "*.xlsx", "D:\¤ñ¹ï\B¸ê®Æ§¨\"
                End If
            
            Next xuo
    End If
Next xt
   'Set objFs = Nothing
End Sub


   

text.rar (40.35 KB)

TOP

·PÁ¦U¦ì¤j¤j¡A¾Ç¨ì«Ü¦h
§Úªº°ÝÃD¸Ñ¨M¤F!!!

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD