- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 277
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-23
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-6-18 08:26 ½s¿è
¦^´_ 7# wsx24680 - Sub Ex()
- Dim Ar(), Mystr$, a$, s&, k%, fs$
- Cells = ""
- fs = Application.GetOpenFilename("Text Files (*.txt), *.txt")
- If fs = "False" Then MsgBox "½Ð¿ï¾Ü¤å¦rÀÉ": Exit Sub
- k = 2
- Open fs For Input As #1
- Do While Not EOF(1)
- Line Input #1, Mystr
- If Mystr <> "" And Not IsDate(Mystr) Then
- If InStr(Mystr, "=") = 0 And InStr(Mystr, "---") = 0 Then
- a = Mystr
- ElseIf InStr(Mystr, "=") > 0 Then
- ReDim Preserve Ar(s)
- Ar(s) = Array(a, Split(Mystr, "=")(0), "=", Split(Mystr, "=")(1))
- s = s + 1
- ElseIf InStr(Mystr, "---") > 0 Then
- Cells(1, k).Resize(s, 4).Value = Application.Transpose(Application.Transpose(Ar))
- k = k + 6: s = 0: Erase Ar
- End If
- End If
- Loop
- If s > 0 Then Cells(1, k).Resize(s, 4).Value = Application.Transpose(Application.Transpose(Ar))
- Close #1
- End Sub
½Æ»s¥N½X |
|