+ Reply to Thread
Results 1 to 5 of 5

Macro for txt to excel.

  1. #1
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    Macro for txt to excel.

    Hi Excel Team,

    Could someone please help i have a problem as of notepad to excel conversion.could someone can solve it would be great

    Iam unable to run macro thorws an error.

    Please help me.

    Regards,
    Shekar.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro for txt to excel.

    Same concepts as in your other thread but this one is even easier. However, with only 2 records shown in your example text file, I fear that something might differ in the production text file's format.

    Will each record be separated by a blank line? Will other header information show as they did in your other text file?

    Since this one is so simple, you could do this manually very easily via menu items Data > Import External Data > Import Data.

  3. #3
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    Re: Macro for txt to excel.

    Hi Hob,

    There is blank line after each row we don't have the price devaiton feed with 50% as of the other txt file which i used earlier.But here the txt headings like Security price feed not recieved will be there after 20 to 30 records like i have given in the txt file here.

    Request you to please suggest me what should i do for this.

    This would be really a great help from you if you could some code for this.

    Regards,
    Shekar.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro for txt to excel.

    You can use the status line in Notepad to get the starting column numbers for the colStart() array.

    I did not know if the last 2 fields are dates or not. I could not tell if they were mm-dd-yy or dd-mm-yy if they were. So, you can set them similar to what I did in the other thread. You will need to modify the Sub SetFormts.

    As I said, this one is even easier than your last one. The logic that I used was that if the first 3 characters were not space characters and the 4th was a space character, then it must be a record line.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 03-22-2009 at 01:22 PM.

  5. #5
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    Re:[SOLVED] Macro for txt to excel.

    Hi Hob,

    You are really at the best.

    I had everseen an expert like.Thanks very much for your help.

    Regards,
    Shekar.

+ 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