View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Open delimited file

Dim fCtr as long
dim myBook as workbook
....get your list of .txt files in to myFiles().

for fctr = lbound(myfiles) to ubound(myfiles)
Workbooks.OpenText Filename:=myPath & myfiles(fctr), Origin:=437, _
...etc
set mybook = activeworkbook
'do whatever you want to continue processing mybook
mybook.worksheets(1).range("A1").value = "hi there!"
next fctr


Al wrote:

The second bit of code does open the text file in itself if I define the
path/file.

How do I add the delimited part to this line....Set mybook =
Workbooks.Open(MyPath & MyFiles(Fnum))

"goshute" wrote:

It looks if your code will open a text file (.txt) and parse the data
into seperate columns on each tab or colon ":" in the text file. If
there are no tabs or colon characters, all the data would remain in
column A.

I would only expect to see only one delimiter for the file, either the
tab or the colon.
Goshute
.


--

Dave Peterson