Peter
how about
Function MySUMPRODUCT2(Divn As Range, Dte, Itm As String)
'AUTHOR: rylo
'DATE: 6/8/07
'REFERENCE: http://www.excelforum.com/showthread.php?t=609767
Dim WrkSH As Worksheet, holder As Long, findit As Range, firstadd As String
Application.Volatile
holder = 0
For Each dn In Divn
If dn Like "Division*" Then
Set WrkSH = Sheets(dn.Value)
With WrkSH
Set findit = .Range("A:A").Find(what:=Itm)
If Not findit Is Nothing Then
firstadd = findit.Address
coloff = WorksheetFunction.Match(Dte, WrkSH.Range("5:5"), 0) - 1
Do
holder = holder + findit.Offset(0, coloff)
Set findit = .Range("A:A").Find(what:=Itm, after:=findit)
Loop Until findit.Address = firstadd
End If
End With
End If
Next dn
MySUMPRODUCT2 = holder
End Function
rylo
Bookmarks