Sub file()
Dim myFolder As String, myFile As String
Dim i As Integer
myFolder = "C:\New folder\"
myFile = Dir(myFolder & "*.xlsx") '就是這裡,想名稱由小到大
i = 1
Do While myFile <> ""
Cells(i, 1).Value = myFile
myFile = Dir()
i = i + 1
Loop
End Sub作者: ui123 時間: 2014-3-3 20:19
還是可以再設一個名 稱清單為 myFile2= myFile的排序
然後:
i = 1
Do While myFile2 <> ""
Cells(i, 1).Value = myFile2
myFile2 = Dir()
i = i + 1
Loop