Results 1 to 5 of 5
  1. #1
    ragsgold is offline Access & Excel Developer
    Windows XP Access 2000
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51

    Lightbulb Export Access to Excel : from a specific row


    Hello All,

    I have Access 2010 and I have 46 queries each one is a specific site data hence 46. I export them to excel and send it to customer. Everything so far was fine until two new requirements got included. New template was designed with a picture Logo in Row A1; row 2 has a note; row 3 has the field names (slightly re-worded compared to queries but the positions remain same); row 4 is where the data starts. Now I want my macro (which i have created to export these 46 queries into excel) to export the data alone (without field names) starting from row 4. I already have these 46 uniquely named excel files (goes by site name which is what is defined in the macro export command too). Now I dont know how to tell access to export data only from row 4

    Can Anyone please help I need to run these reports tomorrow and trying to get a fix for this process so that I need not copy paste from excel to excel.

    Many Thanks in advance

    Raghav

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    You can use automation and CopyFromRecordset. See that section here:

    http://support.microsoft.com/kb/247412

    noting this line, which is telling it where to start:


    oSheet.Range("A1").CopyFromRecordset rs
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ragsgold is offline Access & Excel Developer
    Windows XP Access 2000
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51
    Hi Paul,

    I am sorry I am new to VB and not quite sure as to how I can use this suggestion. I have a macro where I have used 46 importexport spreadsheet giving each site two outputs which when its exported its exported into two sheets with the file name as site name. You would see a file like Open Orders New York and when you open the file you would see two sheets Openorders and No PO each exported from two different queries.

    Can this recordset command use the macro and export in row 4 ? if yes please help how I can code the VB script.


    Thanks again

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    I don't use macros, but to my knowledge you can't specify the starting row in one.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ragsgold is offline Access & Excel Developer
    Windows XP Access 2000
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51
    Hi Paul,

    Is there a way to rewrite this in VB. All I do in the macro is as below ...is there a way you can give a sample VB equivalent action as below ?

    Importexport (standard macro command)

    Spreadsheet type : Excel


    Table name: I give my query name from which it pulls data to be exported.Each site has two tabs so two queries I give the two fifferent query names but the below file name is same so that it creates 1 file two tabs.

    Destination location and file name: I give the folder where i want the data file to be exported with a unique file name for each site.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Import Specific Cells from Excel to Access
    By Evocube in forum Import/Export Data
    Replies: 2
    Last Post: 01-12-2012, 10:35 AM
  2. import specific column from excel to access
    By eshtul in forum Import/Export Data
    Replies: 6
    Last Post: 11-11-2011, 09:54 AM
  3. import specific cell from excel to access
    By maneuk in forum Import/Export Data
    Replies: 10
    Last Post: 07-01-2011, 06:24 AM
  4. Open a specific Excel application in Access
    By Hobbes29 in forum Programming
    Replies: 1
    Last Post: 02-14-2011, 06:48 PM
  5. Export a value to specific Excel cell
    By gg80 in forum Import/Export Data
    Replies: 5
    Last Post: 07-23-2010, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums