日期:2014-05-18 浏览次数:20879 次
Sub Macro1() ' ' Macro1 Macro ' ' ChDir "D:\test" date1 = DateSerial(2012, 3, 1) date2 = DateSerial(2012, 3, 31) dat = date1 Do While dat <= date2 Workbooks.Open Filename:= _ "D:\test\" & Format(dat, "yyyymmdd") & ".Xls" ActiveWorkbook.SaveAs Filename:= _ "D:\test\new\" & Format(dat, "yyyymmdd") & ".csv", FileFormat:=xlCSV, _ CreateBackup:=False ActiveWorkbook.Close Application.DisplayAlerts = False Application.AlertBeforeOverwriting = False dat = DateAdd("d", 1, dat) Loop End Sub