Consulting

Results 1 to 4 of 4

Thread: From text file to excel spreadsheet

  1. #1
    VBAX Regular
    Joined
    Dec 2011
    Posts
    33
    Location

    From text file to excel spreadsheet

    Hi troopers,

    I have a text file that contains TAB delimited data. Here's a sample contents:

    ID[tab]Description[tab]Code[tab]Count
    INN.001.36[tab]Titles[tab]NL[tab]1
    INN.001.37[tab]Titles[tab]NL[tab]1
    INN.001.38[tab]Titles[tab]NL[tab]1
    INN.001.39[tab]Titles[tab]NL[tab]3
    INN.001.40[tab]Titles[tab]NL[tab]1
    INN.001.41[tab]Titles[tab]NL[tab]1
    INN.001.42[tab]Titles[tab]NL[tab]1
    INN.001.43[tab]Titles[tab]NL[tab]1
    INN.001.44[tab]Titles[tab]NL[tab]1
    INN.001.45[tab]Titles[tab]NL[tab]1

    *[tab] are TAB characters

    Now I want the file itself to be converted to an excel file (.xls) so it will look like 4 columns A-D in excel sheet. It should appear in the sheet exactly like the above.

    Any help would be very much appreciated. Thanks in advance...

  2. #2
    With Excel open.
    File - open and under "Files of type" select Text Files (prn, txt, csv)
    Select the text file in question and select "Tab Delimited"

  3. #3
    VBAX Regular
    Joined
    Dec 2011
    Posts
    33
    Location
    Sorry if I didn't explain more but I want a vb code for this so the file will be automatically saved in excel. Thanks much...

  4. #4
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    Just use your macrorecorder and do what Jolivanes explained.

Posting Permissions

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