+ Reply to Thread
Results 1 to 2 of 2

Creating an Excel Report from 7 separate files using VBA

  1. #1
    Registered User
    Join Date
    01-12-2016
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    Windows 7
    Posts
    2

    Creating an Excel Report from 7 separate files using VBA

    This is what I have:
    - 1 Excel report with consolidated data for all customers
    - 6 separate Excel files with detailed information per product, also for all customers
    - Refer to attached Excel template as example

    For all company names in tab “company list” it should create a separate Excel report with:
    - The consolidated data in a separate tab
    - If there is detailed information, this information should be copied from one of the 6 separate Excel files into a separate tab in the new workbook (next to the consolidated data tab)
    - If there is no detailed information for that company, it must continue to the next detailed file

    I know how to create a macro for the copy/paste exercise but not how to automate this for all 7 separate files in one go. Therefore my question:
    Is it possible to create 1 macro that copies all information related to company_1 out of the 7 separate files and paste it into a new file in separate tabs?

    Response very much appreciated!

    Template macro.xlsx

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Creating an Excel Report from 7 separate files using VBA

    I have a question on the format and naming of the detailed information files. Do they all have the headers in row 1. Is there a naming convention for the file names that's dependable?

    If the answer to the first question is yes, then you might be able to use MS-Query to import the data into the detailed information sheets in the main book. If the files always have the same name than this is all you would have to do. If the name changes but in a predictable manner (such as with a date stamp) then some simple VBA code to change the connection string should do the trick.

    If VBA code is required, you can put it in an open workbook event. MS-Query can be set up to refresh data upon workbook open.

    Attach a couple of company detail files with a handful of false data, and I can pull together a bit of a demo.

+ 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. Replies: 0
    Last Post: 07-27-2015, 01:06 PM
  2. PPT pages as separate files with files names from Excel
    By Amarjeet Singh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2015, 05:42 AM
  3. Split Excel report and save separate Workbooks to respective locations
    By seattle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2010, 03:30 AM
  4. Replies: 0
    Last Post: 07-14-2008, 10:58 AM
  5. Open Separate Excel Files in Separate Windows
    By JTWood in forum Excel General
    Replies: 3
    Last Post: 05-07-2006, 05:18 PM
  6. [SOLVED] Creating separate files from multiple sheets
    By Shuvro Basu in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 09:55 AM
  7. [SOLVED] Open Excel files in separate sessions, not just separate windows?
    By Bob at Dexia Design in forum Excel General
    Replies: 1
    Last Post: 10-18-2005, 01:05 PM

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