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

¨ú±o¸ê®Æ§¨¤º©Ò¦³ÀɮצWºÙ

¦^´_ 6# b9208


    ¨º¨SÃö«Y¤~¹ï
°£«D«ü©wªºªþÀɦW¿ù»~®Ú¥»¨S§ì¨ì³o¨ÇÀɦW
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

Dear Hsieh
Array("QWER", "ASDG", "FGHY", "Other Item")
¤W­z¤¤ "Other Item" «üªº¬O°£¤F«e¤T¶µ¥~ªº¨ä¥L¥N½X
¦Ó¤£¬O"¡ªOther Item" ¥N½X¡A­è¤~´ú¸Õ¨ä¥L¥N½X³£¤£¨£¤F¡C
«D±`©êºp»¡©ú¤£¸Ô²Ó¡C
ÁÂÁÂ

TOP

¦^´_ 4# b9208
  1. Sub Sort_Data()
  2. Dim Ar(), Ay()
  3. fd = "E:\" '«ü©w¸ê®Æ§¨
  4. fs = Dir(fd & "*.xls") '«ü©w°ÆÀɦW
  5. Do Until fs = ""
  6. ReDim Preserve Ay(x)
  7. Ay(x) = fs
  8. x = x + 1
  9. fs = Dir
  10. Loop
  11. For Each a In Array("QWER", "ASDG", "FGHY", "Other Item")
  12.    For i = LBound(Ay) To UBound(Ay)
  13.        If Ay(i) Like "*" & a & "*" Then
  14.        ReDim Preserve Ar(s)
  15.        Ar(s) = Array("P" & s + 1, Ay(i))
  16.        Ay(i) = ""
  17.        s = s + 1
  18.        ElseIf a = "Other Item" And Ay(i) <> "" Then
  19.        ReDim Preserve Ar(s)
  20.        Ar(s) = Array("P" & s + 1, Ay(i))
  21.        s = s + 1
  22.        End If
  23.    Next
  24. Next
  25. [A8:B65536] = ""
  26. [A8].Resize(s, 2) = Application.Transpose(Application.Transpose(Ar))
  27. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦U¦ì«e½ú¡I
½Ð±Ð¿é¥XªºÀɮײM³æ«á¡A¥i¥H¦A¨Ì·Ó¦Û©w±ø¥ó¤è¦¡±Æ¦C (BÄæ) ¤Î¥[¤WNo. (AÄæ)¡A¦pªþÀÉ B0.rar¡C

B0.rar (2.53 KB)

TOP

ÁÂÁªO¤j
®a§ä¨Óªº°Ñ¦Ò¸ê®Æ ^^"  À³¥Î¤è¦¡¦A­×¥¿¤@¤U¦P¼Ë¦³®Ä
'====================================
Private Sub CommandButton1_Click()
    Dim P As String
    P = ThisWorkbook.Path '«ü©w¸ê®Æ§¨¸ô®|
    ActiveSheet.UsedRange.Offset(1).Clear
    Get_Picture P
End Sub
Private Sub Get_Picture(ByVal P As String)
    Dim Fs, C As Variant
    Set Fs = CreateObject("Scripting.FileSystemObject").GETFolder(P)
    With ActiveSheet
    For Each C In Fs.Files
        If C Like "*.xls" Then '«ü©w°ÆÀɦW
            .Cells(Application.CountA(.[C:C]) + 1, "C") = C.Name
        End If
     Next
    End With
        For Each C In Fs.SubFolders
            On Error Resume Next
            Get_Picture C
        Next
End Sub
½Ð¦h«ü±Ð

TOP

¦^´_ 1# stephen


Sub get_file()
fs = Dir("C:\®à­±¥¿½T¸ô®|\*.*")
Do Until fs = ""
r = r + 1
Cells(r, 1) = fs
fs = Dir
Loop
End Sub
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD