+ Reply to Thread
Results 1 to 2 of 2

Import Text file Fields as Columns in Excel

  1. #1
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Import Text file Fields as Columns in Excel

    Hi all,

    I have a text file that contains more than 1 lakh lines.
    the text file contains 2 fields, the field length of the 1st field is 22 chars.
    I wanted to import that text file into excel spreadsheet.
    Since the lines in text file is more than 1 lakh, I got help on this forum from RoyUK, to split the text file and write into 2 spreadsheet.
    Code:
    Please Login or Register  to view this content.
    What current code does:
    It reads lines and writes into excel spreadsheet in a active sheet and read line by line.
    What I want:
    I want some changes in the above code that will read the line as 2 fields and write the value of 1st field(22 chars) in column A and the 2nd field in Column B.
    I want the writing/importing to be done from the first cell of the excelsheet and not from any active sheet.

    Hoping for a solution.
    Thanks in advance.
    VIjay

    If you find any of the post useful to your question, please add to the contributor's reputation by clicking the blue scales icon in the blue bar of the post.

  2. #2
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Import Text file Fields as Columns in Excel

    I have modified my text file with comma delimited file and the following code gives me what I want, but with one issue.
    The comma is also written in the first column.
    I dont want the comma to be written.
    Is there any way to do so.
    Have attached the workbook with the macro and the text file for testing.
    code:
    Please Login or Register  to view this content.
    Thanks in advance.
    Attached Files Attached Files

+ Reply to Thread

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