I recently wrote some horrible coding to copy and paste data from source files to the correct location in an output file. While the resulting code does work, it is painful to look at and a hog of system resources. I know that my issue could be resolved by the proper use of looping, but I'm not experienced enough to get it right on my own. I'm hoping that someone here can assist.
Here is a small snippet of the code itself:
The first IF involving Workbooks("ASTdailyAnalysis.csv").Sheets("ASTdailyAnalysis").Range("B2").Value checks to make sure that this cell is not empty. This is the field that will contain the product name.
The second one checks the value of that cell and compares it to the product name field in the template report.
After that copies data from the source sheet Range("E2") and pastes it to the report template field Range("M2")
As you can see from my snippet of code, I have created the loop by just throwing repeating code in. This is what I need to clean up.
Each of the fields needs to increment for up to 60 possible entries in both sheets. Any help on how to fix my mess of ungainly code would be greatly appreciated.
Thanks in advance,
-Belz
Bookmarks