代码如下,防错细节代码自己完善吧:
Dim Pa$, Na$Pa = "D:\ABC\" '特定文件夹,以\结束Na = Dir(Pa & "*.xlsx")While Na <> "" With Workbooks.Open(Pa & Na) fna = .Sheets(1).Range("C1").Text '用于新文件名的特定单元格,这里假定为C1 .SaveAs "改名后存放文件的文件夹\" & fna .Close False Next Na = DirWend