- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# vm3503ru8
¬O³Ì·s¦sÀɪº¤é´Á®É¶¡¶Ü?- Option Explicit
- Sub Exקï¤å¥óÀÉ®×()
- Dim F As Object, E, AR(), i As Integer, A As Variant, xFile As String
- 'Set F = CreateObject("Scripting.FileSystemObject").GetFolder(ThisWorkbook.Path).Files
- Set F = CreateObject("Scripting.FileSystemObject").GetFolder("§Aªº¸ê®Æ§¨¸ô®|??").Files
- '.Files ->³o¸ê®Æ§¨¸ô®|¤¤ªº©Ò¦³ªºÀÉ®×
- ReDim AR(1 To 2, 1 To F.Count)
- For Each E In F
- If E Like "*.txt" Then 'ÀÉ®×°ÆÀɦW¬°txt
- i = i + 1
- AR(1, i) = E '°}¦C²Ä¤@ºû ¸m¤JÀɮצWºÙ
- AR(2, i) = CDbl(E.DateLastModified) '°}¦C²Ä¤Gºû ¸m¤J¦sÀɪº¤é´Á®É¶¡
- End If
- Next
- A = Application.WorksheetFunction.Index(AR, 2)
- xFile = AR(Application.Match(Application.Max(A), A, 0), 1) '³Ì·s¦sÀɪºÀɮצWºÙ
- Set F = CreateObject("Scripting.FileSystemObject").OPENTextFile(xFile, 1) '¶}±Ò¤å¥óÀÉ,Ū¨ú¼Ò¦¡
- A = Split(F.readall, vbLf) 'Ū¨úÀɮפº®e
- F.Close 'Ãö³¬¤å¥óÀÉ®×
- Set F = CreateObject("Scripting.FileSystemObject").CreateTextFile(xFile, True) '¶}±Ò¤å¥óÀÉ,¥iÂл\ì¤å¥óÀɼҦ¡
- For i = 0 To UBound(A)
- F.WriteLine IIf(i > 1 And A(i) <> "", Space(1), "") & A(i)
- Next
- F.Close
- End Sub
½Æ»s¥N½X |
|