Cross-worksheet formulas in evaluate() in VBA
<p>I want to calculate conditional max of the ith column in a sheet called "Data" when the corresponding value in column A of sheet "Data" falls in a range from another sheet "Result". I tried to use the code below but it's wrong:</p>

<pre><code>Worksheets("Result").Cells(r , 4)=Evaluate("=STDEV(IF(Data!A:A&gt;=Result!range(r,1) and Data!A:A&lt;Result!range(r,2),Data!columns(i)))")
</code></pre>

<p>What's the correct way to write the formula?</p>