How can I impliment the Conditional SUM function in VBA?
I need to go down a list of cells in Column Y and do a conditional SUM on each of the unique items listed and put the totals next to each in column Z. which is where I would normally put this on a worksheet.
=SUM(IF(F2:F395="Printer Supplies",U2:U395,0))
Printer Supplies is at Y2 and I need to do all the cells in Y as in
Range("Y2", Range("Y65536").End(xlUp)).Select
Is there a way that you can write a Conditional SUM formula like the one that I have below using VBA ? The worksheet function does not incriment correctly with the Fill Down command anyway.
In this case Printer Supplies is at Y2, so how can I do the equivalent of
{=SUM(IF(F2:F395=Y2,U2:U395,0))}
in VBA and have it go down to the last used cell in that column?
Any code or ideas welcome.
Thanks
I need to go down a list of cells in Column Y and do a conditional SUM on each of the unique items listed and put the totals next to each in column Z. which is where I would normally put this on a worksheet.
=SUM(IF(F2:F395="Printer Supplies",U2:U395,0))
Printer Supplies is at Y2 and I need to do all the cells in Y as in
Range("Y2", Range("Y65536").End(xlUp)).Select
Is there a way that you can write a Conditional SUM formula like the one that I have below using VBA ? The worksheet function does not incriment correctly with the Fill Down command anyway.
In this case Printer Supplies is at Y2, so how can I do the equivalent of
{=SUM(IF(F2:F395=Y2,U2:U395,0))}
in VBA and have it go down to the last used cell in that column?
Any code or ideas welcome.
Thanks