title: Why does this keep saying object-defined error?
body: <p>I've been stuck on this for hours so would really appreciate the help.
  For aa you are supposed to select a range in another workbook to use as a reference.
  The .Cells(11, 3).Formula = line won't stop coming up with object-defined error. Please could I have some help on what is wrong with my formula?
  If I just do .Cells(11, 3).Formula = &quot;text&quot; it works, but I need it to be the formula...</p>
  <pre><code>Dim aa As Range
  Dim bb As Range
  Dim cc As Range
  
  Set aa = Application.InputBox(&quot;&quot;, Type:=8)
  Set bb = Application.InputBox(&quot;&quot;, Type:=8)
  Set cc = Application.InputBox(&quot;&quot;, Type:=8)
  
  
  .Cells(11, 3).Formula = &quot;=INDEX(&quot; &amp; aa.Address(External:=True) &amp; &quot;,MATCH(1,($E11=&quot; &amp; bb.Address(External:=True) &amp; &quot;*(F$9=&quot; &amp; cc.Address(External:=True) &amp; &quot;,0))&quot;
  </code></pre>