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:
(in the calling code:)
-if to insert date into a cell:
[targetObject].Value="A1"
-if to insert date into a textbox:
[targetObject].Value="MyForm.MyDate"
(then, in the Calendar Form):
Object("targetObject").Value = someDate
Everything I tried to refer to the object whose name is stored in [targetObject] failed. Can someone, please, have an idea?