View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default PRoblem with Ranges and Sumproduct under VBA

Have I lost my mind!!! I am trying to count unique occurances using
Sumproduct. I have the sheet defined as well as the ranges. The Ranges are
Dimas Range and the Sheetname is Dim as String. This setup works elsewhere in
my code except that I reference an outside sheet. Here is a snippit of what
works;

xlApp.Evaluate("=SUMPRODUCT(--('[Release Plan (1,2,3,4).xls]" & ShtRef &
"'!" & CntRef3 & " =""TBD""),--('[Release Plan (1,2,3,4).xls]" & ShtRef &
"'!" & CntRef2 & "<""CLS""))")

Here is the code I'm trying to get to run but all I get is a #value error
although the ranges are identical in size, and I'm no trying to reference an
outside sheet

xlApp.Range("I10") = xlApp.Evaluate("=SUMPRODUCT(--(" & _
ShtRef & "'!" & xlRng7.Address & _
"=""Hours""),--(" & _
ShtRef & "'!" & xlRng8.Address & _
"=""100""))")

Does anyone know of a place where the sumproduct feature is reaslly well
documented, ie book, website ect that might help me figure out my own
problems.