Excel reading text stuff ...
I use a macro to read two text files, one a simple list of dates, and the other containing several columns of numbers separated by commas. Maybe this will help.
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 4/26/99 by The Witch ' ' Keyboard Shortcut: Ctrl+A ' ' Range("A10").Select Workbooks.OpenText FileName:="F:\progress\DATELIST.DAT", Origin:=xlWindows, _ StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=True, _ Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1)) Selection.CurrentRegion.Select Selection.Cut ActiveWorkbook.Close Range("A11").Select ActiveSheet.Paste Range("B10").Select Workbooks.OpenText FileName:="F:\progress\TABLE.DAT", Origin:=xlWindows, _ StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=True, _ 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), Array(11, 1), Array(12, 1), Array(13, 1)) Selection.CurrentRegion.Select Selection.Cut ActiveWorkbook.Close Range("B11").Select ActiveSheet.Paste End Sub
Cheers, PW. |