Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Concatenate Excel Files

Reply  
Thread Tools
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
11-May-2009, 03:54 PM #1
Concatenate Excel Files
Hello,
I need help concatenating Excel worksheets from a directory into a single sheet. I have some folders with over 1000 files that I need to combine to run analysis on. They all have the same header and data starts on line A37. Is it possible to just put the next file's data underneath the last with some kind of loop?
One problem is that I also need to add a line to distinguish one file's data from another, maybe a column with the file name on each line.
Does this sound possible to automate?
Thank you for your help in advance!

I know there was a previous thread (http://forums.techguy.org/business-a...cel-files.html), but I don't know how to alter it to remove a larger header and I wasn't able to get the macro to work for me.
DJh6064's Avatar
Computer Specs
Member with 77 posts.
 
Join Date: Apr 2009
Location: Florida
Experience: Advanced
11-May-2009, 08:13 PM #2
This is something you could use Access for. Import all the excel files and append them into one table with an xtra field to identify the data. You could then export all the data to Excel and create a pivot table. A pivot table is a good way to manipulate dat quickly. Not sure how to automate it the import.
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
11-May-2009, 11:12 PM #3
Hi DJh6064, Thanks for replying. The automated import is what I need help on because I have such large quantities of data. I'll give Access a try though.
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
12-May-2009, 04:44 PM #4
Please post a sample file with any sensitive data removed and I'll write the macro for you. What version of Excel are you using?

Regards,
Rollin
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
13-May-2009, 01:09 PM #5
Hello Rollin,
I am using Excel 2003.
Here are a few files that I would like to put together. I would be fine taking the headers off completely.
Thanks!
Amanda
Attached Files
File Type: xls 220508-REN001XXX1-0004.GF.xls (21.5 KB, 125 views)
File Type: xls 220508-REN001XXX1-0005.GF.xls (19.5 KB, 84 views)
File Type: xls 220508-REN001XXX1-0006.GF.xls (19.0 KB, 81 views)
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
14-May-2009, 05:21 PM #6
OK now that I have some visual reference please explain in detail what you would like this macro to do. Does it mater what order the data is imported into the master workbook?

Regards,
Rollin

Last edited by Rollin_Again; 14-May-2009 at 05:31 PM..
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
14-May-2009, 05:47 PM #7
Hi again Rollin,
I would like to combine all the Excel files in a directory to a single file. I need all the header gone, except for Row 1 to be Row 36. I also need a column added that will list the file name that each row is from.
I have thousands of files in some folders and am worried about maxing out Excel's row limit, is it possible to tell it to make a new sheet or file if exceeds the limits?
Order doesn't really matter, but the files go in numerical order throughout the directory and it would be nice if they stayed in that order.
Thanks!!
Amanda
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
14-May-2009, 06:05 PM #8
Will the file structure always be the same? (e.g - rows 1 - 36)

Regards,
Rollin
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
14-May-2009, 06:22 PM #9
Yes, they are always the same structure with the header and same columns.

Amanda
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
16-May-2009, 01:32 AM #10
Save the attached workbook to your desktop or other location and then run the macro called "CombineFiles"

The first part of the macro prompt you for the directory containing your data files. This directory should not contain any files other than those XLS files that you want processed. I really didn't get a chance to test the macro so let me know how it works and what changes need to be made to it.

Regards,
Rollin
Attached Files
File Type: xls CombineFiles.xls (16.0 KB, 324 views)
Amanduh320's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: May 2009
Experience: Intermediate
16-May-2009, 02:41 AM #11
Thank you Rollin! I will play with it in the next couple days. I really appreciate your time and assistance.
Amanda
Reply

Tags
concatenate, excel

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:06 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.