Results 1 to 3 of 3

Thread: Output to Excel Sheet

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

    Output to Excel Sheet

    Hi All,

    I am after some advice, I need to output the contents of an access query to a new excel worksheet. I also need to generate a new worksheet for each new record I pull from the query I am using.

    Does anyone have a sample of the best way to achieve this or able to offer any tips.

    I am a vb developer but I don't do much with Access and Excel.

    Any help or advice appreciated.

  2. #2
    Junior Member
    Join Date
    Mar 2003
    Location
    Mt. Holly, NJ
    Posts
    31
    Hey,

    OK, what you'll want to do is first create a Macro in Access. It should have two lines in it:
    1. OpenQuery (with the name of the query you want to run)
    2. OutputTo (with Object Type as Query, Object Name (your query), OutputFormat as Excel and OutputFile with the path and file name you want exported to.

    This will export all of the records.

    In Excel, you'll just create a simple Macro that goes down and cuts every line and pastes it to a new worksheet. If you need the code for this, let me know.

    -Joshua Wise

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129
    Thanks for your reply,

    the code for the excel macro would be great.

    many thanks

    dagoose

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