Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Sumproduct in Macro

thanks per jessen it worked

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT macro Kim Excel Discussion (Misc queries) 2 September 21st 09 04:36 PM
SUMPRODUCT in macro Office_Novice Excel Programming 3 June 21st 08 01:50 AM
use LIKE within sumproduct in macro, possible? [email protected] Excel Programming 3 August 31st 06 02:42 AM
macro with SUMPRODUCT help [email protected] Excel Programming 8 August 30th 06 10:27 PM
How to use SUMPRODUCT in macro? Tarek Excel Programming 6 April 27th 05 07:03 AM


All times are GMT +1. The time now is 04:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"