I'm creating a user form in Excel VBA and part of the form consists of 12 text boxes which I want to format as date fields dd/mm/yyyy. See attached screenshot.
My code for the first text box is...
' Format the Enquiry date field
If Not IsDate(.Value) Then
MsgBox "Invalid date"
.Value = Format(.Value, "dd/mm/yyyy")
Is there a quicker method of doing this rather than formatting each of the 12 text boxes individually, given that they all have different names ?