giaosy
Thành viên thường trực




- Tham gia
- 6/12/06
- Bài viết
- 205
- Được thích
- 144
Các bác giúp em giải thích tại sao đoạn code này cứ báo lỗi ở dòng chữ đỏ với,
không biết ngoài cách chia cột như thế này thì có cách nào khác hay hơn không. (đây là em ghi macro ra đấy
)
cảm ơn các bác
Mã:
Sub NHAP_TEXT()
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;D:\nguon.txt" , Destination:=Range("A2"))
.Name = "New Text Document"
.FieldNames = True: .RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True: .RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False: .SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437: .TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(1, 2, 1, 2)
.TextFileTrailingMinusNumbers = True
[COLOR=red].Refresh BackgroundQuery:=False[/COLOR]
End With
End Sub

cảm ơn các bác
Chỉnh sửa lần cuối bởi điều hành viên: