- ©«¤l
- 14
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 17
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- 2013
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2017-4-30
- ³Ì«áµn¿ý
- 2019-11-23
|
¤£¦n·N«äª©¤j
§Ú¤å¦r¤å¥óÀɪº¤º®e¤£©w¤@¼Ë@@
¶]¨ì³o¸Ì³£·|¿ù»~
¸Ì±¹Á¸Õ°_¨Ó ²Ä¤G¼Óªº»yªk¤ñ¸û¬O²z·Qªº@@
¦ý¬On§â²Ä¤@¦æ¦³ªÅ¥Õ®æ®³±¼
¦A±a¤JEXCEL¸Ì±
Option Explicit
Dim xPath As String
Sub Ex()
xPath = "d:\" 'ThisWorkbook.Path
Ex_קï³Ì·s¤å¦rÀÉ
Workbooks.Open Latest_file(xPath) '¶×¤JTXT¨ìEXCEL
End Sub
Sub Exקï¤å¥óÀÉ®×()
Dim F As Object, E, AR(), i As Integer, A As Variant, xFile As String
Dim My() As Integer
'Set F = CreateObject("Scripting.FileSystemObject").GetFolder(ThisWorkbook.Path).Files
Set F = CreateObject("Scripting.FileSystemObject").GetFolder("C:\Users\USER\Desktop\data").Files
'.Files ->³o¸ê®Æ§¨¸ô®|¤¤ªº©Ò¦³ªºÀÉ®×
ReDim AR(1 To 2, 1 To F.Count)
For Each E In F
If E Like "*.mea" 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 (i)
Next
F.Close
End Sub
³o¬O¦Û¤v§ïªº ¥i¯à¤£ºÉ²z·Q-..-
data.rar (57.5 KB)
|
|