title: Excel VBA: Refer to objects by name when not knowing object type
body: <p>I created a custom calendar form to insert a date into whether a cell on a sheet or a textbox on a form. When calling the form, I store the name of the target object (cell or textbox) in a cell on a sheet (named, say, targetObject). Then, I want the calendar form to insert the selected date into that object. My problem is that I can't find a way to refer to the target object.
  The code would look something like:</p>
  
  <p>(in the calling code:)</p>
  
  <pre><code>-if to insert date into a cell:
      [targetObject].Value="A1"
  -if to insert date into a textbox:
      [targetObject].Value="MyForm.MyDate"
  </code></pre>
  
  <p>(then, in the Calendar Form):</p>
  
  <pre><code>Object("targetObject").Value = someDate
  </code></pre>
  
  <p>Everything I tried to refer to the object whose name is stored in [targetObject] failed. Can someone, please, have an idea?</p>