- ©«¤l
- 9
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 17
- ÂI¦W
- 0
- §@·~¨t²Î
- 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- taiwan
- µù¥U®É¶¡
- 2013-4-27
- ³Ì«áµn¿ý
- 2014-6-20
|
©êºp§Ú¥i¯à¨S»¡²M·¡
¤U¤èªº»yªk¬O¥i¥H³sÄò¶}±Ò¦b¦P¤@Ó¸ê®Æ§¨¤ºªº¤å¦rÀÉ 1.txt ,2.txt ,...
¨º°²¨Ï§Úªº¤å¦rÀɦW¬°y(1).txt, y(2).txt, ...
¨º½Ð°Ý§Ún¦p¦óקï
·PÁÂ
Sub ¤å¦rÀÉ®×()
Dim txt_name, i, x, oldname
oldname = ThisWorkbook.Name
Range("A1").Select
x = InputBox("Àɮ׼ƶq")
For i = 1 To x
txt_name = i & ".txt"
Workbooks.OpenText Filename:=ThisWorkbook.Path & "\" & txt_name, Origin:=950 _
, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, 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), Array(8, 1), Array(9, 1), _
Array(10, 1)), TrailingMinusNumbers:=True
Windows(txt_name).Activate
If i = 1 Then
Range("A1").Select
Else
Range("A2").Select
End If
Next
End Sub |
|