View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock[_3_] Martin Fishlock[_3_] is offline
external usenet poster
 
Posts: 59
Default can i use sumproduct this way in VB?

Andy,

Can't quite work out your code, but I wrote this little function that works:

Function a()
a = Application.WorksheetFunction.SumProduct( _
Worksheets("A").Range("A2:A9"), _
Worksheets("A").Range("b2:b9"), _
Worksheets("A").Range("c2:c9"))
End Function

if you are trying to do the sumproduct of the above three ranges.



--
HTHs Martin


"Andy" wrote:

Can i use sumproduct in VB the same way in a cell of excel. The only
difference being i am using
application.worksheetfunction.sumproduct(--(Worksheets("A").Range("A2:A9") _
=Worksheets.Range("A1),--(Worksheets("A").Range("b2:b9") _
=Worksheets.Range("b1),--(Worksheets("A").Range("c2:c9"))


Is that possible, or do i need to use a different method to accomplish the
same task?