- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 257
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 4# donod
¸ê®ÆåªR«ü¦W¤Þ¼Æ¤£¯à©¿²¤- Sub input_txt()
- Dim Ay()
- fs = ThisWorkbook.Path & "\test5.txt" 'TXTÀɦW¥Ø¿ý
- ar = Array(";", ":", ":")
- Open fs For Input As #1
- Do While Not EOF(1)
- Line Input #1, mystr
- For i = 0 To 2
- mystr = Application.Substitute(mystr, "/", ar(i), 3) '¨ú¥N¤À¹j²Å¸¹
- Next
- ReDim Preserve Ay(s)
- Ay(s) = mystr
- s = s + 1
- Loop
- Close #1
- fs = ThisWorkbook.Path & "\test5.xlsx" '¼g¤J¥Ø¼ÐÀɮץؿý
- With Workbooks.Open(fs)
- With .Sheets(1)
- .[A1].CurrentRegion.Clear '²M°£ì¸ê®Æ
- .[A1].Resize(s, 1) = Application.Transpose(Ay) '¼g¤J¸ê®Æ
- '¸ê®ÆåªR
- .Columns("A:A").TextToColumns Destination:=.Range("A1"), DataType:=xlDelimited, _
- TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
- Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
- :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
- Array(7, 1)), TrailingMinusNumbers:=True
- .[A:A].NumberFormatLocal = "m/d/yyyy" 'Åܧó¤é´Á®æ¦¡
- End With
- End With
- End Sub
½Æ»s¥N½X |
|