大神給你來段vba 例子瞧瞧,
Sub test()
Dim xls_Folder As String
xls_Folder =
ThisWorkbook.Path
Dim xlsFiles() As String
Dim fso, f, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(xls_Folder)
Set fc =
f.Files
s = ""
For Each f1 In fc
If Not StrComp(Right(f1.Name, 4), ".xls", 1) Then
If s = "" Then
s =
f1.Name
Else
s = s & "|" &
End If
Next
xlsFiles = Split(s, "|")
Dim i As Long
Dim m As Long
Dim n As Long
大神給你來段vba 例子瞧瞧,
Sub test()
Dim xls_Folder As String
xls_Folder =
ThisWorkbook.Path
& "\textxls"Dim xlsFiles() As String
Dim fso, f, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(xls_Folder)
Set fc =
f.Files
s = ""
For Each f1 In fc
If Not StrComp(Right(f1.Name, 4), ".xls", 1) Then
If s = "" Then
s =
f1.Name
Else
s = s & "|" &
f1.Name
End If
End If
Next
xlsFiles = Split(s, "|")
Dim i As Long
Dim m As Long
Dim n As Long