Excel IMport Text Help!!
I need help on the coding. I am wondering why i canot import text field into my excel worksheet. Here is my coding. Is it somehitng wrong with my code or what?? Please help me out..thank very much
sub importfile()
workbooks.opentext _
fileName:="C:\ExcelVBA\Nov2002.txt", _
origin:=xlWindows, _
StartRow:=4, _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(20, 1), Array(27, 1), Array(42, 1), _
Array(49, 1)), _
TrailingMinusNumbers:=True
with ActiveWindow
.width = 452.25
.Height = 254.25
end with
Sheets("Nov2002").Select
Sheets("Nov2002").Move _
Before:=Workbooks("Chapter02.xls"), Sheets(1)
Range("A2").Select
Selection.EntireRow.Delete
Range("A1").Select
End Sub
|