Results 1 to 12 of 12

Excel 2003 importing data from multiple .txt files

Threaded View

  1. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Excel 2003 importing data from multiple .txt files

    sub snb()
      c00="E:\OF\"
      c01=dir(c00 & "*.txt")
    
      do until c01=""
        open c00 & c01 for input as 1
          c02= replace(input(LOF(1),1),vbcrlf,vbcrlf & replace(c01,".txt",Application.International(xlListSeparator))) 
          c03=c03 & vbcrlf & split(c02,split(c02,vbcrlf)(4))(1)
        close
        c01=dir
      loop
    
      open c00 & "all.csv" for output as 1
        print 1,c03
      close
    
      workbooks.open c00 & "all.csv"
    End sub
    Last edited by snb; 06-15-2011 at 11:29 AM.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1