+ Reply to Thread
Results 1 to 3 of 3

how do i make macro program on excell for create new txt file?

  1. #1
    Richard
    Guest

    how do i make macro program on excell for create new txt file?

    Hi all,

    is there anyone can help me, I need make simple macro program.
    I have a text file, inside this txt file there is certain code. Example
    there is code 30 on line 10-15. I need a program that copy line 10-15 and
    create a new file with the content only line 10 until 15 only. Thanks all
    your help guys.

    Best regards

  2. #2
    Don Guillett
    Guest

    Re: how do i make macro program on excell for create new txt file?

    use data>filter>autofilter>record a macro

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Richard" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    >
    > is there anyone can help me, I need make simple macro program.
    > I have a text file, inside this txt file there is certain code. Example
    > there is code 30 on line 10-15. I need a program that copy line 10-15 and
    > create a new file with the content only line 10 until 15 only. Thanks all
    > your help guys.
    >
    > Best regards




  3. #3
    Tom Ogilvy
    Guest

    Re: how do i make macro program on excell for create new txt file?

    Here is a link to sample code to read and write delimited files:

    http://www.cpearson.com/excel/imptext.htm import/export text files

    here is sample code to read in a text file:

    Sub ReadStraightTextFile()
    Dim sStr as String
    Dim LineofText As String
    Dim rw as Long
    rw = 0
    Open "C:\FILEIO\TEXTFILE.TXT" For Input As #1
    sStr = ""
    Do While Not EOF(1)
    Line Input #1, LineofText
    sStr = sStr & lineofText
    if len(sStr) >= 178 then
    rw = rw + 1
    cells(rw,1).Value = sStr
    sStr = ""
    End if
    Loop
    'Close the file
    if len(sStr) > 0 then
    cells(rw,1).Value = sStr
    End if
    Close #1
    End Sub

    Here are other sources of information:


    http://support.microsoft.com/default...b;en-us;151262
    Working with Sequential Access Files

    http://www.applecore99.com/gen/gen029.asp

    --
    Regards,
    Tom Ogilvy


    "Richard" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    >
    > is there anyone can help me, I need make simple macro program.
    > I have a text file, inside this txt file there is certain code. Example
    > there is code 30 on line 10-15. I need a program that copy line 10-15 and
    > create a new file with the content only line 10 until 15 only. Thanks all
    > your help guys.
    >
    > Best regards




+ 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