Results 1 to 7 of 7

Import Text File from line number

Threaded View

Urby1Kinobe Import Text File from line... 05-03-2015, 05:14 AM
mehmetcik Re: Import Text File from... 05-03-2015, 05:25 AM
Urby1Kinobe Re: Import Text File from... 05-03-2015, 05:31 AM
mehmetcik Re: Import Text File from... 05-03-2015, 05:37 AM
Marc L Re: Import Text File from... 05-03-2015, 10:18 AM
Urby1Kinobe Re: Import Text File from... 05-03-2015, 02:46 PM
shg Re: Import Text File from... 05-03-2015, 02:49 PM
  1. #1
    Registered User
    Join Date
    04-09-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    30

    Import Text File from line number

    Hi All,

    Someone on this forum kindly helped by with this to bring in a text file to excel.
    Dim x As Double
    Dim TXT As String
    
    Open "C:\Users\Urby\Desktop\test.txt" For Input As #1
    
    x = 0
    
    Do While Not EOF(1)
    Line Input #1, TXT
    Cells(1, 1).Offset(x, 0) = TXT
    x = x + 1
    Loop
    
    Close #1
    I cannot seem to find the original post for some reason but i firstly wanted to thank them, but secondly ask if there was anyway i could add the import to only start at a different line of the text file rather than the top?

    The text files I will want to import will have titles and headers on the first few lines then the data is from line 4 or 5, i would only like to bring in the data and not the headers/titles etc

    Can anyone help?

    Thank you
    Last edited by Leith Ross; 05-03-2015 at 04:58 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Import second line of text file to spreadsheet
    By dubbdan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2014, 09:11 PM
  2. Replies: 0
    Last Post: 10-31-2012, 09:59 AM
  3. [SOLVED] Import text file from VBA code; import all numbers as text
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2012, 05:19 PM
  4. Reference Text File To Import Using Generic Letter or Number
    By R_S_6 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-02-2009, 09:17 AM
  5. multi-line text file import to excel
    By Waxaholic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2006, 03:45 PM

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