RATE THIS ANSWER
0
Click to Vote:
0
0
Last Answered:
Dec 4 2008 3:43 AM GMT
by JP2112
475 pts.
Yes this can be automated, but you'll need to deal with the "roughly" part. Roughly isn't good enough for VBA.
You'll also need to explain what you mean by "import" -- aggregate all the files into one super-file? What about the headers?
One way is to loop through the files in a folder and open only the Excel files (or I'm sure you could build some kind of file filter with the FileSystemObject).
For a code sample, check out the fourth post in this thread: http://www.forumtopics.com/busobj/viewtopic.php?p=150279
Then you would apply your filter using the AutoFilter Method (see http://msdn.microsoft.com/en-us/library/aa221844(office.11).aspx), and last, you would copy only those columns you wanted over to the new workbook (see http://exceltip.com/st/Copy_a_Column_or_Columns_to_a_Database_sheet_using_VBA_in_Microsoft_Excel/546.html)
HTH