- ©«¤l
- 7
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Win10
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2021-1-11
- ³Ì«áµn¿ý
- 2021-4-17
|
½Ð°Ý¥[¤J¤F¸ê®Æ§¨«Ø¸m§PÂ_¦¡¡A¾ÉP"°õ¦æ®É¶¡¿ù»~5"³oÓ°ÝÃD¡A¬OþÃä¬yµ{¥X¤Fª¬ªp©O?
If Len(Dir(sPath & "Result", vbDirectory)) = 0 Then
MkDir sPath & "Result"
End If
§¹¾ãcode
b = True
Application.DisplayAlerts = False
Application.ScreenUpdating = False
sPath = "C:\Users\Desktop\daliy report demo test_1\"
sFile = Dir(sPath & "\*.xlsx")
Do While sFile <> ""
Workbooks.Open sPath & "\" & sFile, UpdateLinks:=0
If i <> 1 Then
'If Len(Dir(sPath & "Result", vbDirectory)) = 0 Then
MkDir sPath & "Result"
' End If
Sheets(1).Copy
ActiveWorkbook.SaveAs sPath & "Result" & "\" & Format(Date, "mmdd") & "Result.xlsx"
i = 1 '²Ä¤@¦¸¶}±Ò
Workbooks(sFile).Close
Else
Sheets(1).Copy After:=Workbooks(Format(Date, "mmdd") & "Result.xlsx").Sheets(1)
Worksheets(2).Name = "Sheet2"
Call compare
Worksheets(2).Delete
Workbooks(sFile).Close
End If
sFile = Dir()
Loop
Workbooks(Format(Date, "mmdd") & "Result.xlsx").Close SaveChanges:=True |
|