|
原帖由 injureboy 于 2011-8-8 08:10 发表
应该还好吧。都是有一一对应的啊。只是从LSR的文档里面拷贝到excel里面而已啊!
文本文件打开后就是一列(A列)数据,楼主可以根据附件中第二个工作表数据所在位置自己填写:
Sub Macro1()
Dim MyFile, arr, brr(1 To 60000, 1 To 47), i&, m&
ChDrive Split(ThisWorkbook.Path, ":")(0)
ChDir ThisWorkbook.Path
MyFile = Application.GetOpenFilename(FileFilter:="文本文件 (*.lsr),*.lsr", Title:="选择文本文件", MultiSelect:=True)
If TypeName(MyFile) = "Boolean" Then Exit Sub
Application.ScreenUpdating = False
For i = 1 To UBound(MyFile)
Workbooks.OpenText (MyFile(i))
With ActiveWorkbook
arr = .Sheets(1).UsedRange
.Close False
End With
m = m + 1
brr(m, 1) = DateValue(Split(arr(12, 1), ", ")(1))
brr(m, 2) = Trim(Mid(arr(4, 1), 19, 16))
brr(m, 3) = Trim(Mid(arr(8, 1), 19, 16))
' ……后面的看不出来规律,自己填写吧
Next
ActiveSheet.UsedRange.Offset(2).ClearContents
[a3].Resize(m, 47) = brr
Application.ScreenUpdating = True
End Sub
A.rar
(17.41 KB, 下载次数: 62)
|
|