小小尉 wrote:
讀到資料檔案取得檔名...(恕刪)
尉大這我想學 但是 他出現型態不符
Nopadanger wrote:
尉大這我想學 但是 (恕刪)
Dim Path, File_Name As String
Path = "資料夾路徑" 'e.g. "C:\"
File_Name = Dir(Path)
Do While File_Name <> ""
If Mid(File_Name, 1, 4) = "自動彙整" Then ' 判斷檔案前四個字串是否等於"自動彙整"
'複製彙整到檔案A.xls
Exit Do '離開迴圈
End If
File_Name = Dir()
Loop