Results 1 to 11 of 11

Import tab-delimited file

Threaded View

abousetta Import tab-delimited file 06-27-2010, 01:21 PM
pike Re: Import tab-delimited file 06-28-2010, 05:16 AM
snb Re: Import tab-delimited file 06-28-2010, 05:19 AM
abousetta Re: Import tab-delimited file 06-28-2010, 06:11 AM
abousetta Re: Import tab-delimited file 06-28-2010, 06:12 AM
pike Re: Import tab-delimited file 06-28-2010, 06:26 AM
abousetta Re: Import tab-delimited file 06-28-2010, 06:44 AM
snb Re: Import tab-delimited file 06-28-2010, 06:50 AM
abousetta Re: Import tab-delimited file 06-28-2010, 07:01 AM
snb Re: Import tab-delimited file 06-28-2010, 07:25 AM
abousetta Re: Import tab-delimited file 06-29-2010, 04:01 AM
  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Import tab-delimited file

    Hi everyone,

    The code below is a modification to the one in the thread. The original code works fine for comma-delimited files since they whole file takes only one row. When I tried to modify for tab-delimited files, it only imports the first row and then gives me an error (1004). Does anyone know how to resolve this issue?

    Thanks in advance.

    abousetta

    Option Explicit
    Sub TabFile()
    
    Dim TabFile                 As String
    Dim sq
    
    TabFile = Application.GetOpenFilename("Text Files,*.txt")
           Open TabFile For Input As #1
                sq = Split(Replace(Input(LOF(1), #1), Chr(9), "|"), "|")
            Close #1
    'Application-defined or object-defined error (Run-time error '1004' 
           ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, UBound(sq) + 1) = sq
    End Sub
    Last edited by abousetta; 06-29-2010 at 04:02 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