Hi there,
Take a look at the attached workbook and see if it does what you need.
It uses a combination of "native" Excel functions and VBA functions because using the SUMPRODUCT function in VBA can sometimes be less than straightforward!
The formula entered in the worksheet is as follows:
Where Cell B6 contains the name of the worksheet (month) for which the calculation is being performed, Cell C2 contains the relevant Part Number, and Cell C3 contains the latest date which should be taken into consideration.
The "PartNos", "Dates" and "SubTotals" functions are defined in VBA as follows:
The highlighted values may be altered to suit your worksheet layout requirements.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks