Results 1 to 4 of 4

Thread: How to program to copy a text file into a table in Excel ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    How to program to copy a text file into a table in Excel ?

    Using VBA

  2. #2
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: How to program to copy a text file into a table in Excel ?

    Pseudo code:

    get an instance of Excel, if it fails create an instance
    open a workbook or create one
    set an instance to the sheet you want to write on
    open the text file for reading
    write your text to the cell(s) you want.

    tip:
    - search for getobject/createobject and Excel to accomplish the first line of pseudo code
    - search for freefile to see examples of opening a textfile (in a good way)
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to program to copy a text file into a table in Excel ?

    Moved from ClassicVb.

  4. #4
    Lively Member JustinLabenne's Avatar
    Join Date
    Jul 2005
    Location
    Ohio
    Posts
    64

    Re: How to program to copy a text file into a table in Excel ?

    If you are just wanting to Import the text file into the worksheet, you can just record a macro to get the basic syntax used, then clean the code up after it has done most of the work.
    Justin Labenne
    www.jlxl.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width