Good morning/afternoon/evening all. I hope someone is up for (what I think is) a challenge as I've reached the end of my meager expertise!
I'm using Excel 2010 with the workbook in question saved as an Excel 97-2003 Workbook in Compatibilty Mode.
I've been able to piece together a macro that searches Sheet1 (please see the attached workbook) for specific elements in column B then transfers that individual row to Sheet2. I've then sorted both Sheets 1 & 2 by column A, added labels and placed Sheet2's cursor in cell C5 (as per the attached workbook). Looking at Sheet 2 row 5 in the example, I now need to write a Loop statement that will sum columns C, F & G for each unique Rep Name in column A placing those resulting values in C5, F5 & G5, calculate D5 as (F5 * C5) and calculate E5 as (G5 * C5). I then need to copy the name "Emp1" into cell A5, add a label ("Combined Average" or something TBD) to cell B5, move down to the next blank row beneath the next unique Rep Name & repeat the process. Once all calculations are complete, I need to copy each resulting row back into Sheet1 beneath the corresponding unique Rep Name.
The information in and length of Sheet1 will vary from day to day, so the elements being transferred to Sheet2 will never be identical (the Supervisors will be pasting new information into Sheet1 cell A1 every day). Due to that I'm not able to complete Sheet2 with static cell references. The number of blank rows between unique Rep Names as you see in the example can be altered if necessary; I thought having a blank row above & beneath each unique Rep Name might make it easier to perform the calculations.
I don't believe the macro as it exists needs to be added here as it performs flawlessly (so far!). My sincere hope is that someone can assist with the loop statement as I've outlined. If you would like to see the code as it exists now, I'll be happy to add it at your request.
I look forward to any assistance! Thank you for reading my post.
Bookmarks