ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   application.sumproduct help please (https://www.excelbanter.com/excel-programming/337863-application-sumproduct-help-please.html)

Gareth[_3_]

application.sumproduct help please
 
Sheet1 contains approx 2,000 rows of data, I want to summarise this sheet on
Sheet2.

So far I have this:

Sub Macro1()
Dim cell As Range
Set rng = Sheets("Sheet1").Range("L2:L1981")
Set rng1 = Sheets("Sheet1").Range("N2:N1981")
With Sheets("Sheet2")
For Each cell In Range("B2:B51")
cell.Value = Application.SumProduct((rng = cell.Offset(0, -1)) *
(rng1 0))
Next cell
End With
End Sub

Sheet1 - column L contains names and column N contains dates.
Sheet2 - column A2:A50 are names from column L on Sheet1.

I get a Type Mismatch error and haven't been able to fix it. Thanks in
advance for any help/suggestions.

Gareth







All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com