Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sumproduct in Macro
Sub DD()
Dim c As Range Lastcl = Cells(Rows.Count, "A").End(xlUp).Row For Each c In Range("N2:N" & Lastcl).Cells c.Value = WorksheetFunction.SumProduct(--(Range("M2:M" & Lastcl)), -- (Range("H2:H" & Lastcl))) Next c End Sub above macro doesnt work please help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sumproduct in Macro
K, Lets start he If you were to manually enter your SUMPRODUCT formula in cell N2, what would the formula look like? Have a great day, Stan -- stanleydgromjr ------------------------------------------------------------------------ stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=119801 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sumproduct in Macro
it would be
=SUMPRODUCT(($M$2:$M$206=M2)*($H$2:$H$206)) please note that i am trying to put this formula in sheet from another sheet |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sumproduct in Macro
Hi
Try this: Sub DD() Dim LastCl As Long LastCl = Cells(Rows.Count, "A").End(xlUp).Row Range("N2").Formula = "=SUMPRODUCT(($M$2:$M$" & LastCl & "=M2)*($H$2:$H $" & LastCl & "))" Range("N2:N" & LastCl).FillDown End Sub Regards, Per On 27 Jul., 15:59, K wrote: it would be =SUMPRODUCT(($M$2:$M$206=M2)*($H$2:$H$206)) please note that i am trying to put this formula in sheet from another sheet |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sumproduct in Macro
thanks per jessen it worked
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUMPRODUCT macro | Excel Discussion (Misc queries) | |||
SUMPRODUCT in macro | Excel Programming | |||
use LIKE within sumproduct in macro, possible? | Excel Programming | |||
macro with SUMPRODUCT help | Excel Programming | |||
How to use SUMPRODUCT in macro? | Excel Programming |