On my Excel VBA userform there is a textbox where the users should input the date in dd-mm-yy format. If the input is 09-22-13, it should be updated to 22-09-2013. This textbox has a ControlSource property set to an address of a cell; this cell's value should become 22-09-2013, too.
The problem with all events handlers I have tried is that the value of ControlSource gets updated before the handler is triggered, and I cannot change the value of ControlSource unless I hardcode its address (this is something I'd like to avoid).
Could you help? Thanks.
Private Sub TextBox_MyDate_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
TextBox_MynDate.Value = Format(TextBox_MyDate.Value, "dd/mm/yyyy")
' TextBox_MyDate.ControlSource.Value = TextBox_MyDate.Value does not compile
DoEvents
End Sub