+ Reply to Thread
Results 1 to 6 of 6

How to "From Excel to Text document with predefined spaces"

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    4

    How to "From Excel to Text document with predefined spaces"

    Hi all,
    I heard from a friend that this forum is very useful.
    I am facing a problem, as i am not that good in programming.
    i have one excel document containing information of employees, for some purpose i need to convert that information to a text document with some special format which will be loaded in Retail software. unfortunately the number of employees is huge that i can not do it manually or it will take months.

    Employee Information to be loaded transferred to text document:
    employee code, store code, employee name, surname 1, surname 2, post code.

    Format in text document:
    Employee code(8 digits) 8 blanks, then Store Code(4 digits) 3 blanks, then Employee name(20 characters) no blank, then Surname1(20 characters) no blank, then Surname2(20 characters) 15 blanks, then Post code. After this next line and same information for next employee.

    You can see the attached pic also for what format i want in txt document.
    If anybody can help, i will be really thankful.

    Thanks
    Attached Images Attached Images

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

    Re: How to "From Excel to Text document with predefined spaces"

    I don't know where on the document the information is stored but it would be something like:
    Please Login or Register  to view this content.
    You would need to set it up to loop through the different records but each time you use writeline it will put it on a new line.

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to "From Excel to Text document with predefined spaces"

    Hi Bro,
    Thanks. Let me try

    Quote Originally Posted by yudlugar View Post
    I don't know where on the document the information is stored but it would be something like:
    Please Login or Register  to view this content.
    You would need to set it up to loop through the different records but each time you use writeline it will put it on a new line.

  4. #4
    Registered User
    Join Date
    04-26-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to "From Excel to Text document with predefined spaces"

    Hi,
    It gives error "Object doesnt support this property or method"
    Set txtFil = fs.createtxtFil("PATHNAME")

    Thanks
    Quote Originally Posted by yudlugar View Post
    I don't know where on the document the information is stored but it would be something like:
    Please Login or Register  to view this content.
    You would need to set it up to loop through the different records but each time you use writeline it will put it on a new line.

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

    Re: How to "From Excel to Text document with predefined spaces"

    oops, should be createtextfile, not createtxtfile!
    (you also need to change the pathname to somewhere on your computer, eg. "c:\data.txt"

  6. #6
    Registered User
    Join Date
    04-26-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to "From Excel to Text document with predefined spaces"

    Hi,
    Macro is runnign without giving error but there is no output file.

    Thanks
    Quote Originally Posted by yudlugar View Post
    oops, should be createtextfile, not createtxtfile!
    (you also need to change the pathname to somewhere on your computer, eg. "c:\data.txt"

+ 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