- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 2# ui123 - Sub Test()
- Dim myFolder As String
- Dim oFSO As Object, oFiles As Object, oFile As Object
- Dim i, lCnt As Long
- Dim arFiles()
-
- Const HIDDEN = &H2
- myFolder = "C:\New folder\"
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- Set oFiles = oFSO.getFolder(myFolder).Files
-
- ReDim arFiles(1 To oFiles.Count)
-
- '¨ú¥X©Ò¦³ÀÉ®×
- i = 0
- For Each oFile In oFiles
- If Right(oFile.Name, 5) = ".xlsx" Then
- If (oFile.Attributes And HIDDEN) = 0 Then '¤£§tÁôÂÃÀÉ
- i = i + 1
- arFiles(i) = oFile.Name
- End If
- End If
- Next
- If i = 0 Then MsgBox "Not Found" : Exit Sub
- ReDim Preserve arFiles(1 To i)
-
- 'array¤º±Æ§Ç
- Dim temp, j
- For i = 1 To UBound(arFiles)
- For j = i + 1 To UBound(arFiles)
- If arFiles(i) > arFiles(j) Then
- temp = arFiles(i)
- arFiles(i) = arFiles(j)
- arFiles(j) = temp
- End If
- Next j
- Next i
- 'arFiles §Y¬°±Æ§Ç«á°}¦C
-
- MsgBox Join(arFiles, vbCrLf)
- End Sub
½Æ»s¥N½X |
|