Your code is writing the last values after the total is counted. There seems to be no reason why the total is inside the loop. Move the lines
sht1.Range("B6") = Application.....
sht1.Range("C6") = Application.....
after the Loop command.
Regards
MD
Your code is writing the last values after the total is counted. There seems to be no reason why the total is inside the loop. Move the lines
sht1.Range("B6") = Application.....
sht1.Range("C6") = Application.....
after the Loop command.
Regards
MD
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'