- ©«¤l
- 106
- ¥DÃD
- 25
- ºëµØ
- 0
- ¿n¤À
- 141
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2011-10-27
- ³Ì«áµn¿ý
- 2016-4-10
|
[µo°Ý] ½Ð°Ý¦p¦ó§ó§ïVBªº³sµ²Àɮ׸ô®|
³oÓVBA¥\¯à¬O±N¦hÓTXT¤º®e¥þ³¡·|¶°¨ì¦P¤@ÓEXCEL¤¤
¦ý¬O³oµ{¦¡¥²¶·¸òTXT¦b¦P¤@ӥؿý
§Ú¸ÕµÛק令§âµ{¦¡©ñ¦bC:\«ü©w¶×¶°D:\¤¤ªºTXT
¥i¬O³£¨S¦¨¥\
½Ð°Ýn«ç»ò×§ï¤~OK??
ÁÂÁÂ
Sub ¶×¤J¤å¦rÀÉ()
Dim xFile, uFile, uHead As Range, Jm&, Km&, X, xT, xL
Range("A:A").Clear '²M°£Â¶פJ¸ê®Æ
'-----------------------------------------------------
Application.ScreenUpdating = False
Do
If xChk = 0 Then
xFile = Dir(ThisWorkbook.Path & "\*.txt")
If xFile = "" Then MsgBox "¡°§ä¤£¨ì TXT ÀɮסI¡@", 0 + 16: Exit Sub
xChk = 1
Else
xFile = Dir
If xFile = "" Then Exit Do
End If
'----------------------------------------------
uFile = ThisWorkbook.Path & "\" & xFile
Set uHead = Range("A65536").End(xlUp)
If uHead <> "" Then Set uHead = uHead(3, 1)
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & uFile, Destination:=uHead)
.AdjustColumnWidth = False
.TextFileColumnDataTypes = Array(1)
.Refresh BackgroundQuery:=False
.Delete
End With
uHead.Interior.ColorIndex = 6
'¨Cµ§²Ä¤@®æ¥[¡e¶À¦â¡f©³
NEXT_LINE:
Loop
'-------------------------------------------------------
Application.ScreenUpdating = True
MsgBox "¡ã¡ã¶×¤J§¹¦¨¡ã¡ã¡@"
End Sub
¶×¤J¤å¦rÀÉ.zip (8.72 KB)
|
|