Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow &
":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I didn't attempt to set this up; but, just from reading it, I think in each
of your comparisons where you have "" that you actually want """" instead (that will concatenate two quote marks into the text output at those locations. -- Rick (MVP - Excel) "Ayo" wrote in message ... 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the below
c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Jacob. But why am I getting "#NAME?" for this line:
c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=" & c.Offset(0, 1) & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=" & c & "))") c.Offset(0, 1)="DQE Communications" c="NLP2" "Jacob Skaria" wrote: Try the below c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The below works for me. You are overwriting the value in c and teh value in
c.Offset(0, 1)... startrow = 1 endrow = 10 Set c = ActiveCell c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "=" & c.Offset(0, 1) & _ "),--('BO Download'!$E$" & startrow & ":$E$" & endrow & "=" & c & "))") c.Offset(0, 1) = "DQE Communications" c = "NLP2" If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: Thanks Jacob. But why am I getting "#NAME?" for this line: c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=" & c.Offset(0, 1) & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=" & c & "))") c.Offset(0, 1)="DQE Communications" c="NLP2" "Jacob Skaria" wrote: Try the below c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My problem is that the formular in the Evaluate function is not evaluating
correctly. I tried it another way: For Each c In Regws.Range("B" & Regws_startRow & ":B" & Regws_endRow).Cells If c.Row < Regws_endRow Then c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=C" & c.Row & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=B" & c.Row & "))") c.Offset(0, 2).Value should be 126 but it is evaluating to 1 These are the values for the variables: Regws_startRow=4 Regws_endRow=8 startRow=5 endRow=550 "Jacob Skaria" wrote: The below works for me. You are overwriting the value in c and teh value in c.Offset(0, 1)... startrow = 1 endrow = 10 Set c = ActiveCell c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "=" & c.Offset(0, 1) & _ "),--('BO Download'!$E$" & startrow & ":$E$" & endrow & "=" & c & "))") c.Offset(0, 1) = "DQE Communications" c = "NLP2" If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: Thanks Jacob. But why am I getting "#NAME?" for this line: c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=" & c.Offset(0, 1) & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=" & c & "))") c.Offset(0, 1)="DQE Communications" c="NLP2" "Jacob Skaria" wrote: Try the below c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a reason you cannot enter the formula in D4:D7?
Evaluate is not as straightforward as people would like it to be. It's a method, not a function. When used w/o a qualifier it defaults to Application.Evaluate(...) and then the unqualified references to the comparison cells B{n} and C{n} refer to...well, I don't know. You could try using the {worksheet}.Evaluate method but like I wrote at the top, why not enter the formulas in the cells of interest and let Excel do the hard work? On Tue, 20 Oct 2009 11:19:02 -0700, Ayo wrote: My problem is that the formular in the Evaluate function is not evaluating correctly. I tried it another way: For Each c In Regws.Range("B" & Regws_startRow & ":B" & Regws_endRow).Cells If c.Row < Regws_endRow Then c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=C" & c.Row & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=B" & c.Row & "))") c.Offset(0, 2).Value should be 126 but it is evaluating to 1 These are the values for the variables: Regws_startRow=4 Regws_endRow=8 startRow=5 endRow=550 "Jacob Skaria" wrote: The below works for me. You are overwriting the value in c and teh value in c.Offset(0, 1)... startrow = 1 endrow = 10 Set c = ActiveCell c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "=" & c.Offset(0, 1) & _ "),--('BO Download'!$E$" & startrow & ":$E$" & endrow & "=" & c & "))") c.Offset(0, 1) = "DQE Communications" c = "NLP2" If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: Thanks Jacob. But why am I getting "#NAME?" for this line: c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=" & c.Offset(0, 1) & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=" & c & "))") c.Offset(0, 1)="DQE Communications" c="NLP2" "Jacob Skaria" wrote: Try the below c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" Regards, Tushar Mehta Microsoft MVP Excel 2000-present www.tushar-mehta.com Excel and PowerPoint tutorials and add-ins |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
We are going far from where we have started..You are looking for a text 'C4'
and 'B4' in ColD and ColE....respectively....Is that what you want...Try and enter the formula to the cell... For Each c In Regws.Range("B" & Regws_startRow & ":B" & Regws_endRow) If c.Row < Regws_endRow Then c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & _ startRow & ":$D$" & endRow & "=C" & c.Row & "),--('BO Download'!$E$" & _ startRow & ":$E$" & endRow & "=B" & c.Row & "))") End If Next If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: My problem is that the formular in the Evaluate function is not evaluating correctly. I tried it another way: For Each c In Regws.Range("B" & Regws_startRow & ":B" & Regws_endRow).Cells If c.Row < Regws_endRow Then c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=C" & c.Row & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=B" & c.Row & "))") c.Offset(0, 2).Value should be 126 but it is evaluating to 1 These are the values for the variables: Regws_startRow=4 Regws_endRow=8 startRow=5 endRow=550 "Jacob Skaria" wrote: The below works for me. You are overwriting the value in c and teh value in c.Offset(0, 1)... startrow = 1 endrow = 10 Set c = ActiveCell c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "=" & c.Offset(0, 1) & _ "),--('BO Download'!$E$" & startrow & ":$E$" & endrow & "=" & c & "))") c.Offset(0, 1) = "DQE Communications" c = "NLP2" If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: Thanks Jacob. But why am I getting "#NAME?" for this line: c.Offset(0, 2).Value = Evaluate("=SUMPRODUCT(--('BO Download'!$D$" & startRow & ":$D$" & endRow & "=" & c.Offset(0, 1) & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "=" & c & "))") c.Offset(0, 1)="DQE Communications" c="NLP2" "Jacob Skaria" wrote: Try the below c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & _ startrow & ":$A$" & endrow & "<""""),--('BO Download'!$D$" & _ startrow & ":$D$" & endrow & "<""""),--('BO Download'!$E$" & _ startrow & ":$E$" & endrow & "<""""))") If this post helps click Yes --------------- Jacob Skaria "Ayo" wrote: 'c.Offset(0, 3) = Evaluate("=SUMPRODUCT(--('BO Download'!$A$" & startRow & ":$A$" & endRow & "<" & "" & "),--('BO Download'!$D$" & startRow & ":$D$" & endRow & "<" & "" & "),--('BO Download'!$E$" & startRow & ":$E$" & endRow & "<" & "") & ")" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Getting r/t 13 - Type Mismatch on this line - Why? | Excel Programming | |||
Type Mismatch error in VBA code | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
[Q] Save As throws type mismatch error in control's code? | Excel Discussion (Misc queries) |