You can use both; MonthView1.Value
or DateClicked
. The problem is not because of that :)
BTW why do you have Unload Me
in FrmCalendar_Initialize()
? That would give you a Run Time Error 91. Object Variable or With block variable Not set
You are getting Runtime error 424, object required
because it could not find the Txt_Prod_Loc_Date
control on your userform.
If that control is in the worksheet then use it like this
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Sheet1.TextBox1.Value = MonthView1.Value
End Sub
If that control is in some other form (say Userform1
) then use it like this
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
UserForm1.Txt_Prod_Loc_Date.Value = MonthView1.Value
End Sub