+ Reply to Thread
Results 1 to 3 of 3

Text File Importing

  1. #1
    Registered User
    Join Date
    08-15-2011
    Location
    Wilbraham, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Text File Importing

    Hi All,

    First off, glad to be on the forums here.

    I have a question regarding importing text files into a spreadsheet using a Macro in Excel 2007. Below is my code:

    Please Login or Register  to view this content.
    This reads in text from a 6 column text file (.txt) into 6 corresponding columns in a worksheet. My question is about how to skip a line. In each text file, the first line is a blank, then the rest of the 3000 lines are comma-delimited into 6 columns. What could I add to the above code to skip the first line (which is essentially a single character since it has no commas), and properly import the rest of the data.

    With the blank, every cell gets offset by one, and my data is imported incorrectly. I have gotten around this by deleting the space in each text file prior to reading it in, but I think i can account for it in the code.

    Thanks for the help, and sorry for the long-winded question.
    Last edited by NBVC; 08-15-2011 at 02:26 PM. Reason: Remarked Solved properly

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Text File Importing

    MWheeelerFDWT,

    Give the following a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    08-15-2011
    Location
    Wilbraham, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Text File Importing

    Thanks tiger, that did exactly what I needed!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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