After fixing the line breaks in how your message was presented, the only compile errors were due to cell and foundcell not appearing in a Dim statement. Each should be defined as a range.
Whether the code will do what you want is a different question. We would need sample data if you want help with that. Best would be to upload the workbooks to some storage domain where we could download it and test.