Your first example is using Evaluate just in "shorthand" form [ ]
The equivalent longer version would be:
vResult = Evaluate("SUMPRODUCT($D$135:$D$181=""Events and Exhibitio"")*($E$134:$O$134=""CFO""),$E$135:O$181)")
note the double up of quotes... for this reason some prefer the [ ] method.
Evaluate will evaluate any unqualified ranges against the active sheet at run time unless otherwise stipulated.
It follows that if you want your SUMPRODUCT to refer to ranges on a sheet other than the active sheet at run time you should qualify the appropriate sheet either by
a) stipulating the relevant sheet in the SUMPRODUCT itself
SUMPRODUCT((Sheet1!A1:A100)*....)
or
b) qualifying the Evaluate call
With Sheet1
vResult = .Evaluate("SUMPRODUCT(....)")
End With
As mentioned the [ ] and Evaluate( ) methods can generate different outputs (though not necessarily relevant here), example:
Dim strX As String, v1, v2
strX = "{1,2;3,4}"
v1 = [strX]
v2 = Evaluate(strX)
v1 generates a string whereas v2 generates a 2 dimensional variant array
Bookmarks