Solved

Extracting Data from Separate Excel Files

Posted on 2011-09-21
13
176 Views
Last Modified: 2012-06-21
Hello, Experts.

What I need to do is extract the values from a large number of separate Excel files that are all contained in one folder.
For instance, I have cell F7 from a tab named "ChgNotice", cell A17 from the same tab, and cell C1 from another tab named "Data Entry".
The cells and tabs they're located in are the same for all of the files.
I am hoping for something that will put the values of all of the files in this particular folder in a flat file of some kind, either in a database, a spreadsheet, or something I can import.
Is there a good macro solution for this, or some kind of code for MS Access I can use?

Thanks!!
0
Comment
Question by:Nero83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 2

Expert Comment

by:jan24
ID: 36577642
Try this.  You enter the folder path (including final \) in cell A1 and the references you want to read to the right of it.  Then press the Churn button and off it goes.
Book9.xlsm
0
 

Author Comment

by:Nero83
ID: 36581112
Thanks.  However when I run this, it comes up with an error msg box that just says "400" and nothing happens.  I looked at the macro, but this isn't my strong point.  Any ideas on what's causing the problem?  I couldn't find out what the error means.
0
 
LVL 2

Expert Comment

by:jan24
ID: 36581575
Which version of Excel are you using?
Any chance you could send an example file, and my spreadsheet set up as you were using it when you got the error?  If you can do that I'll have a look and see if I can work out what's going wrong.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nero83
ID: 36581726
I'm using 2003.  There was a conversion when I downloaded your spreadsheet.
See attached for Excel file as it ended up on my machine and an example of a file.

Thanks much!
ChurningFeeRecords.xlsm
0
 

Author Comment

by:Nero83
ID: 36581731
OK, here's an example of a file the data's coming from.
14144.xls
0
 
LVL 2

Expert Comment

by:jan24
ID: 36583846
Hi.  The "400" error message is pretty bizarre and unhelpful, but I think I've tracked the problem down.

The range name sources is #REF! in your version - I guess this was caused when Excel 2003 imported it because Excel 2003 can only cope with 255 columns.  If you redefine sources to refer to Sheet1!$B$1:$IV$1 then it should work.

Let me know if that solves it.
0
 

Author Comment

by:Nero83
ID: 36589498
Thanks again!  When you say "redefine sources", I'm unsure where you're referencing to...?  I feel a little dense here, but I looked around and haven't figured it out.  Help?
0
 
LVL 2

Expert Comment

by:jan24
ID: 36598071
Sorry to confuse.  There's a range name called "sources" in the worksheet.  A range name is a way of refering to a cell or range of cells by a meaningful name, rather than having to always use a reference like A1 or C3 in your formulae.

That range name had been "broken" in the process of Excel 2003 converting the workbook from Excel 2007 format to Excel 2003 format.

To fix it, press CTRL+F3 and select the one called "sources" and change the reference that it refers to so that instead of #REF! it is $B$1:$IV$1.

0
 
LVL 2

Expert Comment

by:jan24
ID: 36598075
In case that doesn't work for you, I've made the necessary change in the attached.
Book9-1-.xls
0
 

Author Comment

by:Nero83
ID: 36599852
Thanks again...still having problems with it.  When I save your file, it saves as "Book9-1-.xls".  
When I run the macro, it comes up with an error msg " 'Book[9].xlsm' could not be found..." attached.  I don't see where this file name is in the code or I would try to point it somewhere else or change the name to see if that could help.  I can't save the file with the square brackets in the name.
 Book9-Error-Msg.doc
0
 
LVL 2

Accepted Solution

by:
jan24 earned 500 total points
ID: 36600324
Oh dear - it does seem like Excel 2007 and 2003 don't like talking to each other sometimes!  It seems like the churn button is not correctly remembering which macro is supposed to be assigned to it.

I've tried again saving it as Book10.xls without any brackets.  Hopefully that will fix it.

If you are still having problems with the churn button then try this:
- Go into design mode (look up in Help if you're not familiar with this)
- Right-click on the "Churn This Folder" button
- Click Assign Macro
- Choose the one called Sheet1.churn
Then try it again.

Book10.xls
0
 

Author Closing Comment

by:Nero83
ID: 36600368
Excellent!  This worked perfectly.  I'm not sure how it works, but that'll just take some more time on my part which I don't have right now.

Thanks very much jan24!!!
0
 
LVL 2

Expert Comment

by:jan24
ID: 36600434
You're welcome!
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question