View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default WorksheetFunction.Sumproduct(syntax...

Tom & Bob,
Thanks again for your helpful response.
I'm taking your advice and building arrays to be processed by
WorksheetFunction.sumproduct. Currently, the content of the arrays to be
processed is boolian True or False. I'm asking sumproduct to do the
equivalent of:
?Application.WorksheetFunction.Sumproduct(array(Tr ue,True),array(True,False))
which results in zero instead of the required result of 1 in this case.
I know I could use an 'if' structure when building the arrays to get 1s & 0s
(instead of True, False) and then get the expected result. For interest
though, is it possible to coerce the boolians to 1 or 0 as with the worksheet
methods?
--
David

"Tom Ogilvy" wrote:

Sumproduct, when used in VBA is looking for array arguments. You are trying
to build arrays, but that only works in a worksheet. You will need to use
evaluate to use that type of construct or build the arrays before providing
them to sumproduct.