|
第一点
Sub yy()
Dim sr As String, fd As Boolean, l As Integer, i As Integer
Dim arr() As String, z As Integer
Range("a2:j10000").Clear
oPath = ThisWorkbook.Path & "\"
Filename = Dir(oPath & "*.txt")
Do While Filename <> ""
Open oPath & Filename For Input As #1
Do While Not EOF(1)
Line Input #1, sr
If InStr(sr, "主力持仓统计") Then fd = True
If fd Then
If sr <> "" Then
If InStr(sr, "─") = 0 And InStr(sr, "━") = 0 Then
If InStr(sr, "【") Then
Range("a1") = sr
Else
l = l + 1
z = UBound(Split(sr, "│"))
ReDim Preserve arr(0 To z, 1 To l)
For i = 0 To z
arr(i, l) = Trim(Replace(Split(sr, "│")(i), "-", ""))
Next
End If
End If
Else
Exit Do
End If
End If
Loop
l = l + 2
fd = False
Close #1
Filename = Dir()
Loop
Range("a2").Resize(UBound(arr, 2), z + 1) = Application.Transpose(arr)
End Sub
第二点
能否转2003版,我没装2007版,不知道"数据汇总"样式
[ 本帖最后由 office2008 于 2009-5-4 23:16 编辑 ] |
|