
Originally Posted by
Joaniee
Hello to you all!
I'm looking for some help. I've searched the forums and found several questions similar to mine but I have no idea how to apply the suggestions to what I am doing.
Please keep in mind that I do not (yet) know anything really about macros, VBA, et al.
I will have several workbooks (about 20) that I want to import in one summary. As there are headers in each workbook I don't want that information imported.
I've attached the rough draft. If anyone could help I would be ever grateful!
Also, is there a way for it to figure out that nothing was entered on a row and NOT import that data? If not, how do you write a macro to sort.
Thank you so much for any help!!
In essence you need to perform the following steps starting the macro from within the summary workbook. They will need placing in a loop which accesses each of the tracking logs.
1. Open each of the workbooks.
2. Copy the relevant non zero rows
3. Jump back to the summary workbook and paste the data in the next available cell.
You might also want to consider how you handle the situation where someone wants to resubmit a log that you've already included in the summary. Will you allow this in which case you'll need additional code to delete any relevant rows? In this event you'll probably need to have an extra column in the summary sheet which holds a reference to the tracking log that supplied the data.
Question. How are you determining that a row is empty. Is it a sufficient test that column A is empty for instance? And then is it possible that you can have gaps in the rows? i.e. might there be data in say rows 4,5,7,9, but not in 6 and 8? If the latter is true then you'll probably need an initial sort to make sure that there are no gaps.
Selecting the rows is pretty straight forward since you'll select
The other thing to consider is how are you going to determine which workbooks are the tracking log workbooks. There are two options.
1. Put them all in one folder, and only have tracking logs in that folder, then have the macro open every file in that folder.
2. The other and perhaps safest way is to ensure that the names all have some common text which is unique to the tracking log books. Then the macro can test for the presence of that text before opening the workbook.
If you can answer the Qs above, then post back and no doubt we can work out some fairly simple VBA code.
Rgds
Bookmarks