+ Reply to Thread
Results 1 to 2 of 2

Macro to query based off multiple names in a field and export multiple spreadsheets

  1. #1
    Registered User
    Join Date
    03-17-2015
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2007
    Posts
    5

    Macro to query based off multiple names in a field and export multiple spreadsheets

    Hello, I am using Access 2007 and need a macro that will create multiple tables with each name in the field "Collector" and export it to a folder with each collector's name and the current date.

    So for example,

    If I had Collectors: John Smith, Mary Smith, Joe Schmo, and Larry Field, it would create 4 different spreadsheets with the tables that were assigned to them.

    Is this possible or will I have to make a query for each one and a macro assigned to each creating a spreadsheet for each? Keep in mind the collectors are constantly coming and going.

    Let me know if you have any questions.

  2. #2
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007/10
    Posts
    18

    Re: Macro to query based off multiple names in a field and export multiple spreadsheets

    perfectly possible - but you should not need to create multiple tables, just use queries to collated the data you want

    Assuming you are running code from the access side, you can use transferspreadsheet functionality to export your queries to excel to a file name of your choice. An alternative, or if you want to format the worksheet(s) is to use the Microsoft excel object library to create an instance of excel in code which then uses excel objects and functionality such as range, cell, worksheet etc

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Reference Data from multiple Spreadsheets (Names keep chanding)
    By owenc2088 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2015, 04:29 AM
  2. Show query column names behind pivot table field names
    By gbritton in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-18-2013, 03:17 PM
  3. Query multiple criteria from sql db but only display one field?
    By batador in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-31-2013, 05:13 PM
  4. Replies: 4
    Last Post: 09-18-2012, 06:41 PM
  5. Macro to compare multiple columns between 2 spreadsheets based on a single reference
    By chandra79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2012, 11:13 AM
  6. Merge multiple spreadsheets with common field
    By sbarry50 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2010, 11:42 AM
  7. Names across multiple spreadsheets
    By benstead in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2007, 08:22 AM

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