Results 1 to 4 of 4
  1. #1
    PinkDuster's Avatar
    PinkDuster is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2017
    Location
    Cleveland area
    Posts
    65

    Macro to export query with Total to Excel


    I created a macro to export a query with a total to an Excel file, but the total does not show on the exported file. I did use “export with formatting “ so am not sure why it doesn’t work. It’s the same query underlying a report, and the Total works in the report. Any ideas appreciated!

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you may be looking in the wrong place....
    did you see if the exported query name is correct?
    did you see it the export target filename is correct?
    did you see if the target export sheet name is correct?

    if totals are in the query, then they HAVE to be in the exported sheet.

  3. #3
    PinkDuster's Avatar
    PinkDuster is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2017
    Location
    Cleveland area
    Posts
    65
    Hi RanMan256, yes I checked the paths. Here is the odd part. The macro works one time, the first time it is run. I have it set to ask for a file path, then automatically open the export file in Excel. The first time I run it I see the Total below all the rows. The second and subsequent times, no total. I clear the cache, delete the files, nothing. I copied the macro and gave it a new name. It runs one time correctly, then no Total.

  4. #4
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    that total is not part of the query. queries cannot do that, its an affect of Access to summarize a query, but not in the query.

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

Similar Threads

  1. export total number of results to excel
    By xopherira in forum Import/Export Data
    Replies: 3
    Last Post: 08-25-2015, 10:21 AM
  2. Export to Excel Macro
    By NISMOJim in forum Macros
    Replies: 8
    Last Post: 01-23-2014, 09:09 PM
  3. Replies: 2
    Last Post: 10-20-2013, 02:11 PM
  4. EXPORT to Excel via Macro
    By ruggierm1 in forum Import/Export Data
    Replies: 15
    Last Post: 09-25-2012, 09:33 AM
  5. Replies: 1
    Last Post: 04-30-2012, 05:10 PM

Tags for this Thread

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