Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default PRoblem with Ranges and Sumproduct under VBA

Seems you forgot the " ' " (without quote marks) before the ShtRef ?

cut and paste below and try :-

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

What I have done?: - Andded a ' just after the last bracket in line 1
and line 3.

Try this.

Sharad


"Jeff" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default PRoblem with Ranges and Sumproduct under VBA

Thanks for the quick response. I am having problems still though. I can get
some things to add/count and others refuues. I am using:
xlApp.Range("j10") = xlApp.Evaluate("=SUMPRODUCT(--('" & _
ShtRef & "'!" & xlRng10.Address & """0""))")
Where I want to count up rows and then verify them against other criteria.
However I can't get this to count the cells that are not empty/zero.

What have I done wrong here?


"Sharad Naik" wrote:

Seems you forgot the " ' " (without quote marks) before the ShtRef ?

cut and paste below and try :-

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

What I have done?: - Andded a ' just after the last bracket in line 1
and line 3.

Try this.

Sharad


"Jeff" wrote in message
...
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I use sumproduct with different size ranges? Fen Excel Worksheet Functions 3 December 11th 07 11:19 PM
sumproduct with multiple tab ranges Chuck[_3_] Excel Worksheet Functions 10 October 26th 07 02:58 AM
Sumproduct and Ranges [email protected] Excel Discussion (Misc queries) 2 January 25th 07 04:43 PM
sumproduct between 2 ranges Patty via OfficeKB.com Excel Discussion (Misc queries) 4 July 14th 05 08:53 PM
SumProduct/Date Ranges wal50 Excel Worksheet Functions 3 November 27th 04 11:56 AM


All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"