+ Reply to Thread
Results 1 to 4 of 4

VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    mumbai
    MS-Off Ver
    Excel 2003,2007
    Posts
    2

    VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet

    hello,

    I checked code for the same above query (VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet
    and want to achieve the same functionality as mentioned
    at link http://www.excelforum.com/excel-prog...-to-excel.html.
    but it is not applying to my Created Txt file (Data.txt)
    and given error "Run time error 1004
    Application defined or object defined error"
    But work with texttoexcel.txt

    On further investigation when i found that texttoexcel.txt in Notepad it ends with hidden Characters CR|LF
    but my file Data.txt ends with LF

    Im trying to find the solution but request you if you can help me on this.
    I have added both the Txt files and Book 2 for macro code
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet

    The problem is that your code tries to insert data into column 257 but excel 2003 only has 256 columns.

    Edit: using excels import data built in function puts the data into columns, so the code you have doesn't pick up where the new row begins. I'll have a look and see if I can fix it.
    Last edited by ragulduy; 04-26-2013 at 05:29 AM.

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    mumbai
    MS-Off Ver
    Excel 2003,2007
    Posts
    2

    Re: VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet

    Thanks for ur reply..
    Yes, because it is not considering the Second line and
    inserting the second line(which should come in second row of excel) in the First row itself.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA macro for Inserting text file(having pipe as delimiter) into Excel sheet

    Sorry, I can't come up with a way to get it to recognise the new line properly..

+ 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