title: Calling Excel Solver VBA from another worksheet
body: <p>After creating a new workbook, I am trying to solve a newly created worksheet of this workbook in VBA.  Despite of activating the new worksheet, Solver attempts to solve the worksheet, where the macro lies.</p>
  
  <p>Any suggestions, on how to make sure Solver solves the right worksheet?</p>
  
  <p>I use this code to activate the worksheet.</p>
  
  <pre><code>ws.Activate
  </code></pre>
  
  <p>And this is an example, how I reference the cells in the parametrization of Solver.</p>
  
  <pre><code>SolverOk SetCell:=Range("$E$" &amp; i)
  </code></pre>