Originally posted by HibHib
What is quite interesting about what you're trying to do here is that it's very much akin to Normalising your database, which is a Very Good Thing(tm). For more on that, and I would strongly advise to look at that somewhen, even if it's not too important to this particular thread, see Database Normalisation and Table Structures which is a great introduction to a set of concepts that underpin (or certainly should) all database work. On that point, the total lines wouldn't be considered Normalised. Are you sure they are actually necessary for you?
Using SQL may be possible here, but would certainly be awkward. I'm not saying don't, but I expect VBA would be easier for all concerned. At this point I'll request you post your latest version of code, as amended by the ideas from ADezii, and say what goes wrong and wher. Use line numbers as displayed in the code window on here to identify where the error message is triggered.
Comment